Clamped number list
Clamps a list of numbers to a range and forces a minimum gap between the values.
Inputs
-
list
- The list of values to clamp and space.
-
mode
- Sets the direction that values move in when they sit closer together than the minimum spacing. These are
collapse out from index,collapse up, andcollapse down.collapse out from indexholds the value at the index input in place and pushes the values on either side of it away from it.collapse uppushes values towards the maximum.collapse downpushes values towards the minimum.
- Sets the direction that values move in when they sit closer together than the minimum spacing. These are
-
index
- The index of the value in the incoming list that the rest of the list collapses out from. The first value in the list is index
0.
- The index of the value in the incoming list that the rest of the list collapses out from. The first value in the list is index
-
minimum
- The value that defines the lower bound of the output list.
-
maximum
- The value that defines the upper bound of the output list.
-
minimum spacing
- The value that defines the smallest gap allowed between two values in the output list.
-
pad borders
- When
true, the minimum spacing gap is also applied between the first value and the minimum, and between the last value and the maximum. Whenfalse, values are allowed to sit on the bounds.
- When
Outputs
-
list
- The list of values after clamping and spacing have been applied.
Note(s)
-
The index input only has an effect when mode is set to
collapse out from index. -
The index input counts positions in the incoming list, before any spacing is applied. The output list is sorted into ascending order once the operation has finished.
-
Useful for tidying up the output of a Random number node, keeping generated values inside a usable range and stopping them from bunching together.
-
Other names for this node include: ClampedList.