How to colour a mesh in Grasshopper

Let’s say that you have a mesh and a point. You want to colour the mesh according to how far the different parts of the mesh are from the point.

To do this, we need to:

  1. Import the mesh and the point into Grasshopper
  2. Calculate the distance between the different points on the mesh
  3. Apply these colours to the mesh

Colour a mesh with smooth gradients

Colour a mesh in Grasshopper - smooth

 

Colour a mesh with one colour per face

Colour a mesh in Grasshopper - discrete

Note that here I am using the ‘Mesh Explode’ component to break a mesh into its faces, which is part of the MeshEdit plugin for Grasshopper.

I also have grafted both inputs to ‘Mesh Colour’ – don’t forget to do this! You should quickly see why if you don’t…

If you don’t want to use MeshEdit, you can recreate the behaviour using the slightly more clunky method below:

Colour a mesh with one colour per face - Grasshopper

Finally, if you are writing script, it is also possible to colour a mesh using the C# component. See this post for more information.

7 thoughts on “How to colour a mesh in Grasshopper”

  1. I’m trying to color the mesh faces as solids, but I’m having trouble understanding where the area, distance and point comes into play. If I am applying this to a much bigger surface where do set them? I keep getting an error at the end: Solution Exception: Object Reference not set to an instance of an object.

    1. I’m not sure I understand exactly what your problem is. As a solid mesh (i.e. 3D, closed) or as solid surfaces/Breps? Perhaps it’s best if you share a link to a file you are struggling with.

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.