# Radiance\_tutoral question

**URL:** <https://discourse.radiance-online.org/t/radiance-tutoral-question/6515>\
**Category:** radiance-general\
**Created:** [April 15, 2024, 3:54am UTC](https://discourse.radiance-online.org/t/radiance-tutoral-question/6515 "2024-04-15T03:54:17Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hao](https://discourse.radiance-online.org/letter_avatar_proxy/v4/letter/h/ea5d25/32.png) [@Hao](https://discourse.radiance-online.org/u/Hao)\
**Post date:** [April 15, 2024, 3:54am UTC](https://discourse.radiance-online.org/t/radiance-tutoral-question/6515/1 "2024-04-15T03:54:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Axel\_Jacobs2](https://discourse.radiance-online.org/letter_avatar_proxy/v4/letter/a/46a35a/32.png) [@Axel\_Jacobs2](https://discourse.radiance-online.org/u/Axel_Jacobs2)\
**Post date:** [April 15, 2024, 6:24am UTC](https://discourse.radiance-online.org/t/radiance-tutoral-question/6515/2 "2024-04-15T06:24:12Z")

</div>

Hi Hao,

could you post your room.rad file, please

Thank you  
Axel

---

<div class="post-metadata">

**Author:** ![Jan\_Wienold](https://discourse.radiance-online.org/user_avatar/discourse.radiance-online.org/jan_wienold/32/472_2.png) [@Jan\_Wienold](https://discourse.radiance-online.org/u/Jan_Wienold)\
**Post date:** [April 15, 2024, 6:50am UTC](https://discourse.radiance-online.org/t/radiance-tutoral-question/6515/3 "2024-04-15T06:50:07Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Hao](https://discourse.radiance-online.org/letter_avatar_proxy/v4/letter/h/ea5d25/32.png) [@Hao](https://discourse.radiance-online.org/u/Hao)\
**Post date:** [April 15, 2024, 7:35am UTC](https://discourse.radiance-online.org/t/radiance-tutoral-question/6515/4 "2024-04-15T07:35:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Hao](https://discourse.radiance-online.org/letter_avatar_proxy/v4/letter/h/ea5d25/32.png) [@Hao](https://discourse.radiance-online.org/u/Hao)\
**Post date:** [April 15, 2024, 7:38am UTC](https://discourse.radiance-online.org/t/radiance-tutoral-question/6515/5 "2024-04-15T07:38:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Axel\_Jacobs2](https://discourse.radiance-online.org/letter_avatar_proxy/v4/letter/a/46a35a/32.png) [@Axel\_Jacobs2](https://discourse.radiance-online.org/u/Axel_Jacobs2)\
**Post date:** [April 15, 2024, 7:56am UTC](https://discourse.radiance-online.org/t/radiance-tutoral-question/6515/6 "2024-04-15T07:56:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Hao](https://discourse.radiance-online.org/letter_avatar_proxy/v4/letter/h/ea5d25/32.png) [@Hao](https://discourse.radiance-online.org/u/Hao)\
**Post date:** [April 15, 2024, 8:25am UTC](https://discourse.radiance-online.org/t/radiance-tutoral-question/6515/7 "2024-04-15T08:25:27Z")

</div>

> [@Axel\_Jacobs2](#):
>
> exercise in Section 2.2.3

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

---

<div class="post-metadata">

**Author:** ![Axel\_Jacobs2](https://discourse.radiance-online.org/letter_avatar_proxy/v4/letter/a/46a35a/32.png) [@Axel\_Jacobs2](https://discourse.radiance-online.org/u/Axel_Jacobs2)\
**Post date:** [April 15, 2024, 8:32am UTC](https://discourse.radiance-online.org/t/radiance-tutoral-question/6515/8 "2024-04-15T08:32:42Z")

</div>

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\< --------------------

---

<div class="post-metadata">

**Author:** ![Hao](https://discourse.radiance-online.org/letter_avatar_proxy/v4/letter/h/ea5d25/32.png) [@Hao](https://discourse.radiance-online.org/u/Hao)\
**Post date:** [April 15, 2024, 10:04am UTC](https://discourse.radiance-online.org/t/radiance-tutoral-question/6515/9 "2024-04-15T10:04:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Hao](https://discourse.radiance-online.org/letter_avatar_proxy/v4/letter/h/ea5d25/32.png) [@Hao](https://discourse.radiance-online.org/u/Hao)\
**Post date:** [April 15, 2024, 10:25am UTC](https://discourse.radiance-online.org/t/radiance-tutoral-question/6515/10 "2024-04-15T10:25:01Z")

</div>

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] ..

---

<div class="post-metadata">

**Author:** ![Axel\_Jacobs2](https://discourse.radiance-online.org/letter_avatar_proxy/v4/letter/a/46a35a/32.png) [@Axel\_Jacobs2](https://discourse.radiance-online.org/u/Axel_Jacobs2)\
**Post date:** [April 15, 2024, 10:38am UTC](https://discourse.radiance-online.org/t/radiance-tutoral-question/6515/11 "2024-04-15T10:38:02Z")

</div>

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

```auto
# link geometry to material
bulb_light sphere bulb_geometry
...

```

---

<div class="post-metadata">

**Author:** ![Hao](https://discourse.radiance-online.org/letter_avatar_proxy/v4/letter/h/ea5d25/32.png) [@Hao](https://discourse.radiance-online.org/u/Hao)\
**Post date:** [April 15, 2024, 10:51am UTC](https://discourse.radiance-online.org/t/radiance-tutoral-question/6515/12 "2024-04-15T10:51:35Z")

</div>

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
