Radiance_tutoral question

Hey everyone,

I am new to Radiance. I am following the tutorial material: radiance_tutorial, subsection 2.2.3 More Complex Scenes, page 15. For step 4, I add the command “! genbox glazing_mat glass 4 0 3” in room.rad file, and when I run “objline room.rad | x11meta”, it shows that
Usage: genbox material name xsize ysize zsize [-i] [-b bevel | -r round [-n nsegs][-s]] [-o]
xform: (! genbox glazing_mat glass 4 0 3): warning - empty file

how should I deal with this warning, like in the same folder to create a glazing.mat file?

Cheers,
Hao

Hi Hao,

could you post your room.rad file, please

Thank you
Axel

your “box” has a 0 value in the y-dimension, that causes the problem. A box needs positive values in all dimensions. Do you want to generate a surface rather than a box? If so, then use the command gensurf instead.

Hi Jan,

Thank you so much for your reply. You are right, it is the 0 value in the y-dimension that causes the problem.

I am following the tutorial material which has not introduced the gensurf command yet. So, if I want to generate a pane of glass and place it on the wall, I use the “genbox glazing_mat glass 4 0.01 2” to generate a glass which y-dimension is small and use “xform -t 0 0 1” to place it on the wall. The code is as following:

genbox wall_mat room 4 5 3

wall_mat polygon room.1540
0
0
12
4 0 0
4 0 1
0 0 1
0 0 0

wall_mat polygon room.4620
0
0
12
0 0 3
0 5 3
0 5 0
0 0 0

floor_mat polygon room.2310
0
0
12
0 5 0
4 5 0
4 0 0
0 0 0

wall_mat polygon room.3267
0
0
12
4 5 0
0 5 0
0 5 3
4 5 3

wall_mat polygon room.5137
0
0
12
4 0 3
4 0 0
4 5 0
4 5 3

ceilling polygon room.6457
0
0
12
0 5 3
0 0 3
4 0 3
4 5 3

!genbox glazing_mat glass 4 0.01 2 | xform -t 0 0 1

Hi Axel,

Thanks a lot for your reply. Please see my reply to Jan where I posted the room.rad file.

Thanks again for your help.

Hao

Hi Hao, the little exercise in Section 2.2.3 is actually meant to be done by editing the room.rad text file:

a) run
$ genbox wall_mat room 4 5 3 > objects/room.rad
b) open objects/room.rad in a text editor. It contains 6 polygons, all with wall_mat applied
c) apply ceiling_mat and floor_mat to the ceiling and floor polygons, resp. You have done this correctly.
d) now also identify the south-facing wall. This is room.1540 in your case.
e) copy the 8 lines of the room.1540 polygon and past them into the same file. Let’s call this polygon room.1540window
f) lower the max z coordiantes of room.1540 from 3 metres to 1 metre. This becomes your window sill. Retain the wall_mat material
g) raise the min z coordinates of room.1540window from 0 metres to 1 metres. This is now your glazing. Change the material to glazing_mat

You should now have 7 polygons with 4 different materials in objects/room.rad, forming an air tight box.

A

1 Like

Hi Axel,

wow~ thank you so much! Your reply is very clear and helped me a lot to understand the Radiance. I really appreciate it. I have followed your suggestion to replace “!genbox glazing_mat glass 4 0.01 2 | xform -t 0 0 1” with polygon room.1540window.

Also, can I ask you another question about step 6 of the exercise in Section 2.2.3. I created the bulb.rad file is as follows, but it does not work. Could you please tell me how to finish this step or where I can see the tutorial material to finish this step?

Thanks again!

Hao

!xform -t 0 0 0

void light bulb_light
0
0
3 1 1 1

modifier sphere bulb_geometry
0
0
4 0 0 0 0.3

There is no need for the xform line. Your bulb.rad file should look like so:

------------------------- 8< --------------------
void light bulb_light
0
0
3 1 1 1 # Find more realistic values by following Section 2.3.3!

bulb_light sphere bulb_geometry # link geometry to material
0
0
4 0 0 0 0.03 # 3 cm = 0.03 m
------------------------- 8< --------------------

1 Like

Hi Axel,

Really appreciate your explanation and revision. This also really helps me to understand the relationship between modifier, type and identifier. I will follow your suggestion to revise the RGB value of the material.

Many thanks,

Hao

Hi Axel, I revised the bulb.rad as follows. But when I run the command: objline bulb.rad | x11meta, it has the following errors. could you please help me to fix this error?

Best regards,
Hao

Bulb.rad

void light bulb_light
0
0
3 0.25 0.25 0.25

bulb_light sphere bulb_geometry # link geometry to material
0
0
4 0 0 0 0.03

Error:

xform: (bulb.rad): bad sphere “bulb_geometry”
/tmp/ol.lQ8ST2/bulb.orig: bad argument syntax for sphere “bulb_geometry”
getbbox: fatal - (bulb.orig): bad arguments for sphere “bulb_geometry”
xform: (bulb.orig): bad sphere “bulb_geometry”
getbbox: fatal - (standard input): bad arguments for sphere “bulb_geometry”
Usage: mgf2meta [-t thresh] {x|y|z} xmin xmax ymin ymax zmin zmax [file.mgf] …
Usage: mgf2meta [-t thresh] {x|y|z} xmin xmax ymin ymax zmin zmax [file.mgf] …
Usage: mgf2meta [-t thresh] {x|y|z} xmin xmax ymin ymax zmin zmax [file.mgf] …
Usage: mgf2meta [-t thresh] {x|y|z} xmin xmax ymin ymax zmin zmax [file.mgf] …

Sorry abou this. I should have placed my comment outside of the primitive, like so:

# link geometry to material
bulb_light sphere bulb_geometry
...

Apologies, Axel. This is my fault. I am unfamiliar with Linux and caused this fool error. Sorry again and thank you very much for your help. I appreciate your assistance.

Warm regards,

Hao