Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Appending a Rad file into your scene. #570

Open
Orc1905 opened this issue Nov 21, 2024 · 1 comment
Open

Appending a Rad file into your scene. #570

Orc1905 opened this issue Nov 21, 2024 · 1 comment

Comments

@Orc1905
Copy link

Orc1905 commented Nov 21, 2024

Hi I have been attempting to import a CAD file into radiance for a while now, but have thus far been struggling. I have tried dxf2rad but don't think this function exists in Radiance anymore, now i have been trying obj2rad, so far i have successfully converted obj files into rad files in anaconda but now i can't seem to import these radiance file into my scene on bifacial_radiance. I have been trying to add it to the scene through AppendtoScene() but can't seem to get it working. Anyone had similar issues to this/successfully figured it out?

@ingebrh
Copy link

ingebrh commented Feb 11, 2025

I hope you found a solution to your problem, but just in case you didn't, or someone else has a problem with wavefronts:

I just do RadianceObj.radfiles.append('path\filename.rad') instead of AppendtoScene(). Radiance will build it all into the octree anyway. You can also just throw out the .rad file that is created by bifacial_radiance if your CAD file includes the modules.
Successfully using obj2rad can be tricky though, as obj2rad will need specific instructions to work properly. Otherwise you'll be stuck with a .rad file that doesn't have the correct format. This will also lead to things not working.

When you export to wavefront (.obj), be careful to make sure axes are correct.
The easiest way to use obj2rad is to create textures in whichever 3D modeling program you're using and name them after the textures you are going to use. When exporting, group by material. If done correctly, the resulting .rad file will have the correct format.

For example, if the wavefront (.obj) file has this format:

o Module_C_under
v -0.406497 -0.849622 4.602869
v -0.406247 -0.852479 4.606965
v -0.475749 -0.058068 5.159238
v -0.475499 -0.060925 5.163334
v 0.547857 -0.766127 4.602869
v 0.548107 -0.768984 4.606965
v 0.478605 0.025427 5.159238
v 0.478855 0.022570 5.163334
s 0
g Module_C_under_black
usemtl black
f 48409 48410 48412 48411
f 48411 48412 48416 48415
f 48415 48416 48414 48413
f 48413 48414 48410 48409
f 48411 48415 48413 48409
f 48416 48412 48410 48414

  • Then the result of using 'obj2rad filename.obj > filename.rad' will be these six faces (in my case we're at face number 36307(can't recommend))
black polygon Module_C_under.36307
0
0
12
          -0.406497          -0.849622           4.602869
          -0.406247          -0.852479           4.606965
          -0.475499          -0.060925           5.163334
          -0.475749          -0.058068           5.159238

black polygon Module_C_under.36308
0
0
12
          -0.475749          -0.058068           5.159238
          -0.475499          -0.060925           5.163334
           0.478855            0.02257           5.163334
           0.478605           0.025427           5.159238

black polygon Module_C_under.36309
0
0
12
           0.478605           0.025427           5.159238
           0.478855            0.02257           5.163334
           0.548107          -0.768984           4.606965
           0.547857          -0.766127           4.602869

black polygon Module_C_under.36310
0
0
12
           0.547857          -0.766127           4.602869
           0.548107          -0.768984           4.606965
          -0.406247          -0.852479           4.606965
          -0.406497          -0.849622           4.602869

black polygon Module_C_under.36311
0
0
12
          -0.475749          -0.058068           5.159238
           0.478605           0.025427           5.159238
           0.547857          -0.766127           4.602869
          -0.406497          -0.849622           4.602869

black polygon Module_C_under.36312
0
0
12
           0.478855            0.02257           5.163334
          -0.475499          -0.060925           5.163334
          -0.406247          -0.852479           4.606965
           0.548107          -0.768984           4.606965

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants