How to create a metal perforated radiance material with LBT

Hallo dear @chris

I would need to create a metal perforated radiance material for a glare analysis using the LBT.

I saw this script (Hydra Viewer), which explains how to create it with the legacy version, but I don´t find for the new LBT1.3 the component Honeybee_Add to Radiance Library, I can’t find it, or is it not yet available?
Possibly, would there be another method?

Thanks in advance

1 Like

Hi @LaFleur,

To recreate that example, you can use the Mixfunc class. In the example below I use the from_string method. We can add mesh_material using the add_dependent method. As you can see in the right panel, this method will add the modifier before the mixfunc modifier. If you want to replace void* with a modifier, you can simply add another modifier to the input dependent - as you can see in Python it adds all modifiers in the list called dependent.

*I mean this “void”: “6 mesh_material void y_hole …”

Download the example here: mixfunc.gh (12.4 KB)

2 Likes

dear @mikkel thanks for the help.

I tried to test the perforated material inside the LBT sample file for the ViewBased solution and the PitView component give me this error:
PitView_error
did I do something wrong?

Kind regards

Can you run it if you replace the perforated modifier with a regular glass modifier?
Did you make sure you have the file perforate.cal?

Anyway, can you share the Grasshopper file?

Sorry Mikkel, I forgot to attached the file:
edit_viewbased.gh (79.2 KB)

Yes with a regular glass modifier, work.
Where do I find or should be the file,perforate.cal, inserted?

This might be the problem then. Try put it in c:/radiance/lib folder and run the recipe again.
perforate.cal (1.1 KB)

1 Like

now works!!
Thanks for your time Mikkel.

Greetings

1 Like

Hallo dera Mikkel,
sorry if I bother you, I hope you can resolve a my doubt.

I don´t understand how to manage the dimensions and the distance between the perforation.
What do the values A, B and C in the 3 strings?
4345193fd8fe85d9f146911eadb22fc514c5d308

I thought the B and C values controlled the size of the perforation, but I don’t understand with what criterion.
Per ex. in the screen below, the height of the blind is 10cm, but when I set 0.1 (is this 10cm?) in the string, the diameter is much smaller.

Am I wrong or not understanding something?

Thanks and best regard

The value A is the specularity of the metal Radiance modifier. Dion Moult got some examples of different values. The default in LBT is what you got - 0.9.

The value B is used to scale the perforation (it is 1 by default). C is the relative size of the circles (the radius). In perforate.cal this value is referred to as A1, so I will name it like that in the following.

In this example the surface has the following dimensions: width: 5.0 m, height: 2.5 m.

Settings: -s 1, A1 0.5
As you can see, since the relative radius is 0.5 m, I get 2.5 circles along the height.

Settings: -s 1, A1 0.45
Self explanatory… just decreasing the radius because I want some spacing between the holes.

Settings: -s 0.1, A1 0.45
I scale by 0.1. This means the radius goes from 0.45 m to 4.5 cm.

Settings: -s 0.01, A1 0.45
Further scaling of 0.01. Now the radius is 0.45 cm. Diameter is 0.90 cm. If I wanted the holes to have a diameter of 1.00 cm (radius = 0.005 m) I would have to scale by 0.005 / 0.45 = 0.0111… instead of 0.01.

In your image you have set the radius to 0.1 m and then scaled by 0.1, so the radius is 0.01 m. This means the circle diameter is 2 cm, which judging by your image seems a reasonable estimate. Try start with -s 0.01, A1 0.5 (after scaling: radius 0.5 cm, diameter 1.0 cm). Check if this gives a result like my first image where the circles are just touching each other.

5 Likes

thank you for your thorough explanation,
I needed a 1,1mm (diameter) perforation with a 2,4mm between the holes (is this distance editable?).
This i the result, do you think the perforation is so small that it cannot be properly visualized or am I wrong in the calculation?

,

I don’t think you can edit the distance. You will have to control the distance by the circle diameter - as the diameter decreases the distance increases - and then scale afterwards. If the 2.4 mm is the distance between the centre of each circle here is my best guess on how to get that with a diameter of 1.1 mm:

  1. We need to find the radius. We can use the ratio 0.55 / 2.4. r = 0.55 / 2.4 = 0.229167.
  2. Now that we have the radius we can scale the perforation. You want the radius to be 0.00055 m. Use the formula I mentioned above: 0.00055 / 0.229167 ≈ 0.0024.
  3. Try: -s 0.0024, A1 0.229167.

This image shows a 100 mm x 100 mm surface with the above settings. The view point is rather close to the surface so the perforation is clearly visible. I think with a small size like 1.1 mm you don’t have to move far from the surface to get to a point where it cannot be properly visualised.

1 Like

I sincerely thank you for all your help Mikkel

Hallo dear Mikkel,

unfortunately I need to disturb you again for a last help.
To have the same metal perforated material in HB+ (to test and work with your imageless DGP script) change the procedure in writing the python file? How can add it into the + version?

Greetings and best regards

I think the easiest way is to create the Radiance description of the surface with perforation yourself. Like this file: perf.rad (264 Bytes)

You can then add the file as a scene:

If you do this you must also remove the surface from the Honeybee model to avoid a double appearance of the surface.

The only problem is that the recipe uses the blacked geometry:

So to run the recipe you should:

  1. Write the recipe in runRadiance component.
  2. Go to scene/extra in the written folder. Likely to be “C:\ladybug\untitled\gridbased_imagelessglare\scene\extra” if you didn’t add any input to _folder_.
  3. Edit the file blacked scene file you added to the recipe. Mine is called “perf_blacked.rad”. The needed changes are seen in the image above.
  4. Go to “C:\ladybug\untitled\gridbased_imagelessglare” and run the batch file called “commands.bat”. If you try to run the recipe in runRadiance component it will re-write and the edited file will be gone.
  5. Import the result files in GH.
1 Like

Hello dear @mikkel,
I tried to follow your steps and I came to a empty result:

  • I have convert the Blinds in a RadScene through the _Mesh2Rad component;

  • Connected the new RadScene into the RunRecipe and started the component;
    (Here is the first error)

  • I edit the new blacked.rad files into the “C:\ladybug\untitled\gridbased_imagelessglare\scene\extra”, following your screen (are the strings written correctly?)

  • …after, I run the batch file “commands.bat” and re-run the RunRadiance, but the error remain. In practice the generated files are empty.

did I do something wrong?

Seems correct. As long as you edit the generated file called [insert_filename]_blacked.rad (and overwrite the file with your changes).

Sorry, I see I didn’t make it perfectly clear that you should NOT run “runRadiance”. So the process goes:

  1. Write “runRadiance”.
  2. Edit [insert_filename]_blacked.rad.
  3. Run “commands.bat” manually by double-clicking the file.
    3.1. Optionally, add “pause” at the end of “commands.bat”. This will let the cmd window stay open after executing the Radiance commands so you can see if Radiance reports any errors.
    pause
  4. Import the result files in Grasshopper manually instead of using the output of “runRadiance”.

Thanks for the explanation,
this is the error from the debug

Can you please share the whole folder written by runRadiance?

Thanks Mikkel,
https://fspit2storage.blob.core.windows.net/fspwinappblobs/20211104/27f8dd7d-bd42-4a0c-a199-8bc798df7988/gridbased_imagelessglare.zip

There is something wrong on line 22 in commands.bat. This is how it should be:


This is yours:

I really don’t know why black.mat is not there when writing the files.

Furthermore, the first line of void_mixfunc_y_perforation_blacked.rad is wrong. See below. I am also not sure why this is incorrect if this is how the file was written by the recipe. But you can make these changes manually and then run commands.bat manually.
EDIT: Nevermind about the last thing I mentioned. I think it should run if you just add scene\extra\black.mat as shown in the first image.