How to add colour information onto mesh

Hi there,

I have used the brightest colour pixels from image sampling to generate mesh forms using cellular automata script. I just want to know how can I keep or add the colour information of the image I used and apply that onto the mesh forms? I tried just by attaching an image sampler towards the end of my script but the form will just disappear.


Sorry I can only attach a picture of my script as the file is too big. But, I got this script from Gediminas Kirdeikis’s utube tutorial. (https://www.youtube.com/watch?v=HNnnSB6aMxk&t=1883s)

And this is how it looks like without the image sampling

If anyone know how I can deal with this, it would be very helpful!

Thank uuu

Hello
You can use Mesh Deconstruct and Construct Mesh to put a color at each vertex of your mesh.
So you must feed the image sampler with the same number of 2D point (most of the time { [0 1], [0 1]) as the number of vertices of the mesh.

Hi,

Is there a way to specify which colours to apply on the mesh? The colours on the mesh now is a bit wack. I tried to reduce the x-y domain points in image sampler from 0 to 1 to 0 to 0.5 to reduce the number of colours but nothing changed.

What I’m trying to do here is creating a boundary line (pink line in the viewport) and only sample those colours. But, I am not sure what components I could use to get grasshopper sample colour in rhino and then apply it on mesh or if that is even possible. Thank uu

Hello
it is not clear what you want.
An image is in the 2d space , if you do nothing {[0,1] [0,1]}


You must find something that transform the 3d point in 2d so you could find a color then put this color on the mesh vertex.

If there is a logic so there must be an equation and then a solution.
Here a simple way to apply image on top view (I hope it is just legacy components)
Calculate coordinate of sphere in XY plane
Remap coordinate to fit in [0-1]


Don’t change the coordinates of the image
image
apply color to mesh.gh (3.7 MB)