Grasshopper

algorithmic modeling for Rhino

So I have a definition that produces a 27000 'houses' that I want to render. But I'd like to have a lot of different colors of houses, so I'm wanting to have each assigned to a random layer (idk, up to 15 layers maximum?) but I'm not sure exactly how to do this. I tried the below definition, but in the end all the layers were created but the geometry was only assigned to the last one. so it defeated the purpose. 

Let me know if you know the solution!

Thanks.

Views: 1385

Replies to This Discussion

Hi ,

This could be done with FabTools or Human plugin with a bit of data managing, but here is a custom solution.

You have three ways of layer-material generation:

- supply the customColors_ you want. Each customColor corresponts to layer color and material (diffuse) color. If you supply less customColors than houses, then some houses would be put in common layers. Supply more customColors than what the houses you have - and you will end up with some layers being empty

- do not supply customColors_ but supply NoLayers_ instead. This will create a number of layers which correspond to the to NoLayers_. If you have more houses than NoLayers_, then some of them would be put in the common layer, with the common material color. If you have less houses than NoLayers_ you will have empty layers.
Layer and material colors are generated randomly

- do not supply neither customColors_ nor NoLayers_. All houses would be put in a single layer, each house will have a separate material color, generated randomly.

The definition requires ghpython plugin to be installed.

Attachments:

Thank you very much djordje! It worked as I was hoping. Im sure learning how to write script would help me out. as you know, have the ability to work beyond the limitations of the program. Very cool. I had a second question, do you think it's possible to sort layer colors by something, like house volume, for example? So that all large houses would be pink, medium green, small yellow, etc. This isn't needed right now, I was just curious if it was possible.

It's possible.

Supply three colors you would like to have as three separate layers based on house's volumes, and set largeMediumSmall_ to "True".


Check the attached file.

Attachments:

djordje, thank you. your help is much appreciated.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service