Repeat (LogiX node)
The Repeat node in the Math category takes two arguments, N and Length and outputs the result of the following calculation
- N - floor(N/Length) * Length
so that the output goes between 0 and Length in a repeating fashion, as described in Usage.
Inputs & Outputs
Color | Label | Type |
N | float | |
Length | float |
Color | Label | Type |
* | float |
Usage
This node repeats values between 0 and Length, as N is increased. When N is 0, the output is 0, and then the output increases with N, until N reaches the value Length, and it goes to 0, and repeats this pattern for ever. This pattern looks like a positive-valued sawtooth wave as shown below, for a value of Length=2.2
Here is an interactive version of the function, where l is Length https://www.desmos.com/calculator/7cg7gadknr
Note: This node behaves in the same way as Modulus operator (denotes %) in other programming languages, like Python. LogiX uses the different definition of % which C# uses, and therefore offers the Repeat node when the above behaviour is desired.
The Repeat01 (LogiX node) is equivalent to this node, where Length is set to 1.