[Grasshopper]How to use the Construct Domain to create a numeric range

[Grasshopper]How to use the Construct Domain to create a numeric range Grasshopper component EN

This article explains how to use the Construct Domain to create a numeric range.

Construct Domain1
Construct Domain2

On the Grasshopper, it is displayed as either an icon or text.


↑Youtube Channel

Create a numeric range

Create a numeric range

The basic Construct Domain usage is to be able to create a range of numbers.

In this case, 5 is input to the Construct Domain(A) and 20 to the Construct Domain(B).

The resulting output is 5 To 20.

This would mean a range from 5 to 20.

Example Usage of the Created Domain

Let’s take a look at an example of using a range created with Construct Domain.

Example of using Range component

Rangeコンポーネント

Use this Range component at first.

Three range

Connect the numeric range created by the Construct Domain to the Range(D).

Then, enter a numerical value for how many more divisions of the range you wish to make in the Range(N).

In this case, we entered 3.

Extract numbers from three ranges

Looking at the output results, four numbers were extracted: 5, 10, 15, and 20.

This is because we extracted the numbers that create the three ranges 5~10, 10~15, and 15~20.

Example of Random component usage

Random

Next, use the Random component here.

This component is used to generate random numbers.

Five random numbers are output.

Connect the range created by Construct Domain to the the Random(R).

Then, input the number of random numbers you wish to create to the Random(N).

Then five random numbers in the range of 5 to 20 are output.

Move the object by the number in the range.

Move the object by the number in the range

We would like to move an object using the numerical values of the range we have created.

In this case, we will use Move and Unit Z to move the cube in the direction of the Z axis.

only 15 moved

Thus, only 15 moved as a result in the Z-axis direction.

This is because it moved by the Construct Domain range of 20-5=15.

Thus, Construct Domain can also be used as a subtraction.

Decompose and extract the first and last numbers of a range

Deconstruct Domain

The Deconstruct Domain component can be used to deconstruct a range and extract the first and last numbers in the range.

retrieve a value of 5 and 20

We were able to retrieve a value of 5, the beginning, from the Deconstruct Domain(S) and a value of 20, the end, from the Deconstruct Domain(E).

List of Grasshopper articles using the Construct Domain component↓

Comment

Translate »