How to color geometries in SDK?

Hi,
I’m creating some geometries (2D faces) with the SDK.
I’m struggling on how to assign a color to each of those faces but no success so far.
The only module i’ve found to do that is:

from ladybug_rhino.color import color_to_color

from_face3ds_to_colored_mesh((Face3D(tck_pts)), color_to_assign)

but it is not working for me. Can’t get how to assign the color to the geometry.

Will appreciate any pointers, or working example, showing how to make it happen.

Thanks,
-A.

Hey @AbrahamYezioro ,

Any of the ladybug_geometry Mesh objects (Mesh2D or Mesh3D) can accept a list of colors that aligns with either thier faces or vertices.

Hi @chris,
I’m trying hard but the colors are still not working.
If you can, and want, check the attached file.
I’m outputting various possibilities: Surfaces, Meshes and invalid meshes (don’t get why). The code defines the colors on lines 50-53 as different types (Ladybug, Color and list). Lines 57 and 58 define the meshes, one without color and the other with. The last one, when uncommented, gives an error about the color type.
Line 62 defines a mesh from a face. The result is an “Invalid mesh”. Don’t get why?

In short, I’m not there yet unfortunately …

Thanks,
-A.

Wall_tmp.gh (12.3 KB)

Hi,
Finally i get it.
Attached a very simplified and short example file.
Hopefully somebody can find this useful.

-A.

ColorMesh_Test.gh (7.5 KB)

1 Like

Sorry for not seeing the post until now, @AbrahamYezioro . Glad that you figured it out!