This article explains how to use Integer to set integers.


On the Grasshopper, it is represented by either of the two above.
Setting Integers
Integer can be used to set integers.

Input integer numbers to the left terminal.
The integer numbers are then set in Integer.

Since it is an integer, negative numbers can also be set.
Rounding Decimals to Integers
Decimals can be rounded to integers by connecting them to Integer.

Entering a decimal number as an integer will round it to the nearest whole number, as shown in the image above.
However, since everything is rounded to an integer, it is not possible to specify a decimal place to round to.
If you want to round to a specified decimal place, use the Round function of Expression to round.
Converting Boolean values True and False to numeric values
Boolean values True and False can also be converted to numeric values.

Connect True and False to Integer like this.
Then True is converted to 1 and False is converted to 0.
Specifying an Integer Directly to a Component
You can also specify an integer directly in a component.

To specify an integer directly, right-click on Integer and select Set Integer.
Then enter an integer and click Commit changes.

To directly specify multiple integers, right-click on the left terminal and select Set Multiple Integers.
Then enter multiple integers and click Commit changes.
List of Grasshopper articles using Integer component↓




Comment