Natsura 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

== Inputs ==

=== Repeat Begin ===

Input 0: Incoming graph.

=== Repeat End ===

Input 0: The subgraph to repeat.

Parameters

Overview

The Repeat Node facilitates recursive growth by iterating over a block of nodes for a defined number of cycles. This allows users to efficiently model repetitive structures, such as : - Segmented Stems: Stacked modules for trunks or branches.

  • Fractal Patterns: Recursive branching systems, including phyllotaxis.
  • Iterative Adjustments: Incremental changes across growth stages.

Key Features:

  • Automates repetitive tasks with minimal manual setup.
  • Configures recursive growth through a single parameter.
  • Efficiently models self-similar structures with fewer nodes.

Explicit Recursion

The Loop

Parameters

Repeat Count : The number of times to execute the subgraph. Each iteration evaluates the enclosed nodes, allowing for recursive behavior. Default: 4 Range: 2-10

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.

  • Grow Node — Often used inside Repeat blocks. Incrementally creates plant structures by defining the size, shape, and direction of individual branches.
  • Split Node — Can be repeated to create fractal structures. Enables axillary branching by splitting growth into separate paths.
  • Switch Node — Can change logic per iteration. Enables transitions between different growth behaviors based on attribute-driven thresholds.
  • Repeat Node — Reevaluates Grow over multiple iterations to generate branching hierarchies.
  • Signal Node — Guides plant growth using external data such as vector fields or collision geometry.
  • Simulate Node — Processes the procedural graph and environmental inputs to generate complete plant structures.
  • Prune Node — Removes components of the plant structure to simulate natural shedding or manual trimming.
  • Wrangle Node — Allows users to write custom VEX code for advanced procedural control.

@intro

Getting Started

If you're new to the Natsura toolkit, begin by visiting the Overview|../../natsura/index. The index provides a comprehensive overview of the system, including descriptions of all nodes and how they work together to create procedural plant models. It's the ideal starting point for understanding core concepts and deciding which nodes to explore first.

@attributes

== Attributes ==

The following attributes are updated each iteration:

u: Normalized loop index 0..1. Updates every iteration.

repeat_index: Integer counter for the current iteration.

@workflow

== 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).

@applications

== Applications ==

  • Modular Structures:
    • Simulate segmented stems or trunks with incremental adjustments.
    • Create repetitive architectural elements like trellises or lattices.
  • Fractal Growth:
    • Model recursive branching patterns observed in nature.
    • Generate phyllotaxis and other geometric plant formations.
  • Iterative Changes:
    • Apply transformations incrementally across growth cycles.
    • Simulate growth over time with adjustable iteration counts.

@notes

  • Iterative Nature: Each iteration reprocesses the enclosed nodes, creating a layered or modular effect.
  • Efficient Design: Reduces complexity by automating repetitive operations through a single control parameter.
  • Integration: Works seamlessly with other nodes, such as Grow and Map, to drive parameter variations across iterations.