Honeybee + custom materials

Hi !

Is it possible to input other materials than BSDF, glass or plastic in Honeybee+ ?

I’m espicially interested in mixfunc (http://radsite.lbl.gov/radiance/refer/ray.html#Mixtures)

Thank you - Toby

Yes. As far as you don’t have a modifier. See this: Material definition (Trans, BRTDfunc..) in Honeybee +

If you’re dealing with a modifier you need to wait a couple of more days. I have started implementing the support for modifiers but haven’t finished it yet.

1 Like

Thank you very much for your answer @mostapha

mixfunc is a mixture hence a modifier, so I’ll wait a couple of more days
(“Primitives can be surfaces, materials, textures or patterns. Modifiers can be materials, mixtures, textures or patterns. Simple surfaces must have one material in their modifier list.” - http://radsite.lbl.gov/radiance/refer/ray.html#Primitive)

Makes sense. For now you may want to use the workaround that I mentioned here: Material definition (Trans, BRTDfunc..) in Honeybee +

Thank you

If I’m not mistaken “mixedfunc” should be changed to “mixfunc” under TYPES here:

Source: http://radsite.lbl.gov/radiance/refer/ray.html#Mixtures


Good catch @tobiaspedersentsp ! I have created an issue for this: https://github.com/ladybug-tools/honeybee/issues/217

Yes. That is a bug. Thank you for reporting. I’m re-implementing the materials as part of primitives and it is fixed in the new version. I haven’t pushed it to GitHub yet as 1. it’s not finished and 2. some of the changes will break the current Grasshopper plugin.

@tobiaspedersentsp, can you share the sample material that you are trying to use with me so I can use it for testing the code?

I also realized that I over-complicated the approach for using CustomMaterial as is. You can just path the full modifier definition as the modifier argument and the current version of Honeybee[+] will work fine.

microshade_mat.rad (216 Bytes)
microshade_a.cal (3.1 KB)

.rad file contains the following:


.cal file should be placed under …\Radiance\lib

1 Like

@mostapha I can see that you finished implementing the solution - is there a way for me to start using it already (do you know where I can find userObjects etc)?

Thank you

Use update component to update the installation. You can also download and replace them manually from GitHub. Keep in mind that you need to overwrite both the libraries and userobjects. Let’s start with using the update component which tries to exactly do what I mentioned!

1 Like

Hi @mostapha,

which is the best workflow to create a material with modifiers? Does the new “version” support .cal file?



PS. I have updated the HB+ version using the component.

Hi @AndreaZani905, As long as the cal file is in RAYPATH it should work fine. Honeybee parses the materials recursively so if you have all the materials and its modifiers in the same file it should be parsed correctly. There is not components but you can create your own with a couple of lines of code.

Hi @mostapha,
I have a couple of questions about the creation of new materials:

  1. I tried to create the component for a normal trans material but I got this error: Solution exception:‘module’ object has no attribute ‘by_single_reflect_value’ . How can I solve it? You can find the component attached.

  2. I noticed that in the python material definition there is the option to import from a string. How does it work? Could I import something like the definition below as a string:

void glass glass_alt_mat
3 0.96 0.96 0.96

void brightfunc glass_angular_effect
2 A1+(1-A1) (exp(-5.85 Rdot)-0.00287989916) .
1 0.08

glass_angular_effect mirror glass_mat
1 glass_alt_mat
3 1 1 1

Thank you so much.


Trans_def_HB .gh (5.6 KB)