Repeat
Defines a looping block in the graph. Encapsulates a subgraph between Repeat Begin and Repeat End, re-evaluating it N times with time-varying attributes.
The Repeat concept is implemented as a pair of nodes: Repeat Begin and Repeat End.
- Block Structure: Any graph logic placed between Begin and End is encapsulated.
- Re-evaluation: The subgraph is executed
Ntimes. - Time-Varying: Attributes like
uandrepeat_indexupdate each iteration, allowing the subgraph to evolve (e.g., getting smaller, rotating, or changing probability).
Concept
Explicit Recursion While Grow has a built-in repeat for convenience, the explicit Repeat block allows for more complex recursive structures. You can wrap multiple nodes (Grows, Splits, Switches) to repeat an entire logic chain.
The Loop
- Begin: Marks the start of the loop.
- End: Defines the exit condition (
Repeat Count) and updates loop attributes. - Fraction: Allows for partial iterations (e.g., growing 3.5 steps).
Inputs
Repeat Begin
- Input 0: Incoming graph.
Repeat End
- Input 0: The subgraph to repeat.
Parameters
Repeat Count The number of times to execute the subgraph.
Fraction A multiplier for the count.
Fraction = 1.0: Full execution.Fraction < 1.0: Limits the realized steps (useful for animating growth).
Delay Offsets the start of the repetition, useful for staggering growth across different branches.
Attributes
| Attribute | Meaning |
|---|---|
u | Normalized loop index 0..1. Updates every iteration. |
repeat_index | Integer counter for the current iteration. |
Workflow
- Place a Repeat Begin node.
- Build your subgraph (e.g., a Grow node set to single-step, followed by a Split).
- Terminate with a Repeat End node.
- Set Repeat Count on the End node.
- Use the
uattribute inside the subgraph to drive parameters (e.g., mapWidthtouso the repeated segments taper).