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 N times.
  • Time-Varying: Attributes like u and repeat_index update 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

AttributeMeaning
uNormalized loop index 0..1. Updates every iteration.
repeat_indexInteger counter for the current iteration.

Workflow

  1. Place a Repeat Begin node.
  2. Build your subgraph (e.g., a Grow node set to single-step, followed by a Split).
  3. Terminate with a Repeat End node.
  4. Set Repeat Count on the End node.
  5. Use the u attribute inside the subgraph to drive parameters (e.g., map Width to u so the repeated segments taper).

NodeRelationship
GrowOften used inside Repeat blocks
SplitCan be repeated to create fractal structures
SwitchCan change logic per iteration