Bake objects on different layers based on colors

Hi there,

I have created a simple definition to assign gradient colours to louvre screens (see attachment)

I would like to know what is the approach to bake the objects on different layers based on their colour?!

Anyone can help me out or point me in the right direction?

Thanks! JB

coloured gradient louvers facade.gh (17.5 KB)

Ciao Jacopo,
Bello ribeccarsi sul forum!

First thing you may want to reduce the number of colours or you will have nearly one layer for every sunshade.
to create layers and bake I would use the Human addon


coloured gradient louvers facade_resample&bake.gh (27.3 KB)

P.S. remember to internalise rhino geometry when you share scripts

Hey

Here is my version with Elefront !
As Guido said, you have 118 different colors, so I guessed you wanted 118 layers.
You didn’t internalize your data, so I created arbitrary rectangle, but just plug back your curve and it be fine !
Is this what you were looking for?

coloured gradient louvers facade.gh (21.6 KB)


Thank you guys for such a quick and prompt response.

@guido ma sei il guido di Sydney?giusto :slight_smile:

@antoinemaesantoine yes is exactly what i was after… now i can assign different materials to different colours /layers over 14 levels…

Basically I am trying to recreate a similar facade concept…thanks again I will keep you posted with my progress…

1 Like

It would really help if you internalized your geometry. I used a circle but needed a radius of 16,000 units (a diameter of 32K!) to properly see your model. Are you working in millimeters?

I added a ‘reduce colors’ group (purple) that rounds your random rotation values to specific intervals defined by Range.

This solution uses no plugins:


bake_gradient_louvers_2020JFeb14a.gh (30.2 KB)

Instead, it uses a couple of simple Python components (in the cyan group) documented here:

http://www.islandcad.com/grasshopper/bake_to_layer/

It’s possible to trigger a bug in this code but easy to avoid it. I think it goes like this:

  • click the ‘Bake’ button - this creates layers as needed for baking geometry.
  • manually select and delete all the layers in the ‘Layers’ panel.
  • click the ‘Bake’ button again - ERROR! This alert pops up for every single piece of geometry in the list (150 times!!!) :frowning:

error

I’m still too weary of Rhino API scripting to bother figuring it out just yet. Maybe someday, unless McNeel decides before then to build this functionality into GH, where it rightfully belongs. The ‘Bake’ and ‘DELETE All’ buttons can be used repeatedly without any problem.

Good advice but I didn’t see internalized geometry in your model?