Honeybee Vtk - custom colours / ColorSets

Hi everyone,

I’m building an app using Streamlit that runs a couple of simulations.

I’d like to customise the colours of the mesh results. For example, I’m running a view analysis and calculating a mean value per room. Instead of using the default honeybee_vtk.ColorSets, I’d like to apply custom colours based on those values.

Is that even possible?

I’ve tried so many different approaches—subclassing ColorSets, overriding the defaults… nothing worked. At this point, I surrender :white_flag:

Has anyone managed to customise mesh colours in honeybee_vtk? Any guidance or examples would be greatly appreciated!

Here’s how I’m currently setting the colours using 'view_study':

cs = ColorSets.view_study
vtk_model.sensor_grids.add_data_fields(all_results, name=study_name, per_face=True,colors = cs, data_range=(0, 50))

Many thanks in advance :pray:

Juliana

Hey @jucroffi ,

Yes, but you’ll want to set up your VTK visualizations as VisualizationSets. Any VisualizationSet can be translated to a VTK visualization using the ladybug-vtk package. So this completely bypasses the use of the honeybee-vtk package, which is essentially deprecated at this point. If you are working from a Honeybee Model, then you can use the honeybee-display package to translate your Honeybee Models (and Radiance results) into a ladybug-display VisualizationSet.

If you look at the attributes that are available on VisualizationSets, you will see that any AnalysisGeometry under a VisualizationSet can have ladybug-core LegendParameters assigned to it. Ladybug LegendParameters allow you to assign any colors you want, which will be carried through to the VisualizationSet and VTK visualization.

I hope that helps.

2 Likes

Hi @chris,
Many thanks for your answer.
I will migrate to ladybug-vtk and test it :slight_smile:

1 Like