[Grasshopper] How to use Mesh Colours to set colors on a mesh

[Grasshopper] How to use Mesh Colours to set colors on a mesh Grasshopper component EN

This section explains how to use Mesh Colours to set colors on a mesh.

Mesh Colours1
Mesh Colours2

On the Grasshopper, it is represented by either of the two above.


↑Youtube Channel

Setting colors to a mesh

Mesh Colours can be used to set colors on a mesh.

mesh sphere

We will start with the sphere of the mesh shown here.

Components used

Components used: (1) Mesh Sphere (2) Color Swatch (3) Mesh Colours

Connect the sphere created in Mesh Sphere to the Mesh Colours(M).

In this case, we input 50 to the R Mesh Sphere(R) and set the radius to 50.

Then, input color information to the Mesh Colours(C).

This time, we create a pink color in the Colour Swatch.

the color is reflected

Then, the color is reflected in the mesh as shown here.

Specifying multiple colors for a mesh

Multiple colors can be specified for a mesh.

a triangular mesh

For simplicity, a triangular mesh is used here.

three colors

First, let’s input three colors to the Mesh Colours(C).

Each vertex is now assigned a color

Each vertex is now assigned a color.

two colors

Now, let’s input two colors to the Mesh Colours(C).

two colors for three vertices

Then, since there are only two colors for three vertices, the same color is assigned to two vertices.

Thus, if there are not enough colors for the number of vertices, the same color is assigned to more than one vertex.

4色入力

Now let us try to connect four colors that exceed the number of vertices.

the last color entered is not reflected

Then, the last color entered is not reflected.

In this case, the last color entered, red, is not reflected.

Thus, if the number of colors exceeds the number of vertices, the extra colors will not be reflected.

Specifying a gradient to a mesh

Gradients can also be specified on a mesh.

This time, we will change the color according to the height of each mesh vertex of the sphere as shown in the previous example.

Specifying a gradient to a mesh
Click to Zoom

Components used: (1) Mesh Sphere (2) Deconstruct Mesh ( 3 ) Deconstruct (4) Bounds (5) Deconstruct Domain (6) Gradient (7) Mesh Colours

The sphere mesh created by Mesh Sphere is used to extract the mesh vertices from the Deconstruct Mesh(V).

Then, extract the height values of the points from the Deconstruct(Z).

Then extract the maximum and minimum values of each height number in Bounds.

Then output the maximum and minimum numerical values separately in Deconstruct Domain.

The Deconstruct Domain(S) outputs the minimum value and the Deconstruct Domain(E) outputs the maximum value.

Furthermore, connect the Deconstruct Domain(S) to Gradient(L0), Deconstruct Domain(E) to Gradient(L1), and the Deconstruct(Z) to the Gradient(t).

This creates a gradient whose color changes with height.

Set the gradient according to your own preference.

Finally, connect the Mesh Sphere to the Mesh Colours(M) and the Gradient to the Mesh Colours(C).

the gradient can now be set

As you can see, the gradient can now be set according to the height.

You can also create gradients in this way.

List of Grasshopper articles using Mesh Colours component↓

Comment

Translate »