Grasshopper

algorithmic modeling for Rhino

Hi,

I am trying to use the color from a mesh I created using Geco/Ecotect to inform part of my design.  I created a honeycomb surface in grasshopper and want to control the size of the openings based on the insolation data.  As of now, I can do this uniformly through a slider.  I would like to somehow be able to use the RGB data to do this based on color at a given point so that components can have openings that vary in size.  The honeycomb is based off of a surface and the ecotect import is a mesh.  Can I collect the color data from the closest mesh vertice to my component centroid and convert it to a number (0-1)?  How might I do this?  

Any help would be greatly appreciated.  

Thanks

Views: 6765

Replies to This Discussion

If you've got a mesh that's colored by vertex (I expect this is the case) the decompose mesh component will give you the color for every vertex. If you find the index of the closest mesh vertex to the opening you want to create, you can use this to get the color of that vertex and use the split ARGB component to extract numerical information from the color.

I don't know how your mesh is colored, so the process of getting a value in the range of 0-1 might be as simple as getting the red or green or brightness component of the color, but if it's a complex gradient related to that range, you could try rebuilding the gradient in grasshopper and feeding it an evenly spaced range of values from 0-1. Then try finding the closest color in the gradient to the color from the mesh with the "find similar member" component, which in turn will allow you to get the input value that generated that color.

Since a picture's worth a thousand words:

Thank you so much!  This is exactly what I was hoping to do.  

... see this thread if you have problems with the find similar component...

http://www.grasshopper3d.com/forum/topics/populate-by-gradient-rgb

make colours act as points... genius.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service