This article explains how to use Construct Mesh to create a mesh.


On the Grasshopper, it is represented by either of the two above.
Creating a mesh
Construct Mesh allows you to create a mesh.
To create a mesh, input point, face, and color information.

In this article, we will use the six points above to explain the process.
The order of the points (index numbers) is shown using Point List.

Components used: (1) Point (2) Point List (3) Colour Swatch (4) Merge (5) Construct Mesh
Input point information to the Construct Mesh(V).
In this case, input the point information set in Point.
Input face information to the Construct Mesh(F).
For the face information, enter Q{number;number;number;number} for a rectangle and T{number;number;number} for a triangle. *Q and T can be omitted.
In the numeric part, enter the order of the points (index number).
Initially, Q{0;1;4;5} is entered.
Color information is input to the Construct Mesh(C).
The color is then assigned to the position of the point corresponding to the color order entered.
In this case, the six color swatches are combined by Merge and connected to the Construct Mesh(C).

A mesh like the one in the image above is then created.
As specified in the Construct Mesh(F), Q{0;1;4;5}, so the mesh is created from four points: 0, 1, 4, and 5.

If we look at the color, we can see that the corresponding color is assigned to the order of the points.
Therefore, red is assigned to point 0, orange to point 1, blue to point 4, and purple to point 5.

Now let’s try to create a triangle mesh.
This time, we changed the Construct Mesh(F) to T{1;2;3}.

Then a mesh created from points 1, 2, and 3 was created, as shown here.

If we look at the colors here, the corresponding colors are assigned in the order of the points, and the colors 1, 2, and 3 are used.
Therefore, point 1 is assigned orange, point 2 is assigned yellow, and point 3 is assigned green.

As shown above, it is possible to omit Q and T from the Construct Mesh(F).

Even with this omission, a mesh was created.
Using Deconstruct Mesh
By using Deconstruct Mesh on an existing mesh, you can also use Construct Mesh using the extracted point and face information.

In this case, we will use this existing mesh to create a new mesh whose color changes depending on its position in the x-direction.

Components used: (1) Mesh (2) Deconstruct Mesh ( 3 ) Deconstruct (4) Bounds (5) Deconstruct Domain (6) Gradient (7) Construct Mesh
The mesh set in Mesh is connected to Deconstruct Mesh to extract point and face information of the mesh.
The point information is extracted from the Deconstruct Mesh(V) and connected to Deconstruct.
The Deconstruct(X) outputs the numerical value of the X coordinate of the point position.
By connecting the Deconstruct(X) to Bounds, a range consisting of the minimum and maximum values of the X coordinate values is created.
By using Deconstruct Domain, the minimum and maximum values of the numeric value of the X coordinate are extracted.
Then, the Deconstruct Domain(S), which outputs the minimum value of Deconstruct Domain, is connected to Gradient(L0) and the Deconstruct Domain(E), which outputs the maximum value, to Gradient(L1).
The Deconstruct(X) is connected to the Gradient(t).
Then, set any gradient in Gradient.
Finally, connect the Deconstruct Mesh(V and F) to Construct Mesh(V and F), and connect Gradient to Construct Mesh(C).

As you can see, a mesh whose color changes according to the position of the X coordinate has been created.
In this way, Construct Mesh can be used with the point and face information extracted by Deconstruct Mesh.
List of Grasshopper articles using Construct Mesh component↓
Comment