Prune

Removes branches during growth by re-testing conditions across multiple cycles, simulating natural die-back and self-pruning.
Experimental. Behaviour and parameters may change.

The Prune node removes existing branches when conditions are met. It evaluates attributes on internodes and marks them for deletion, re-evaluates over multiple cycles (so branches can be pruned later in life when they get too old or crowded), and supports a start delay to allow initial growth before pruning begins. Two testing modes are available: Threshold compares an attribute against a value; Expression evaluates a custom VEX rule.

Inputs

InputDescription
Input 0: GraphThe incoming Natsura graph.

Attributes

Prune consumes attributes but does not typically emit new ones. Common inputs:

AttributeDescription
heightCommon pruning input.
ageCommon pruning input.
uCommon pruning input.
generationCommon pruning input.
densityCustom pruning input.

Outputs

OutputDescription
Output: GraphThe graph with pruned internodes removed.

Parameters

Condition

ParameterDescription
Use ExpressionThreshold removes components based on attribute or value thresholds; Snippet removes them based on a custom VEX snippet condition.

Threshold

ParameterDescription
Compare AttributeThe attribute name for the first operand (when Type A is Attribute). Common choices: height, age, u, generation.
OperationComparison operator: ==, !=, >, >=, <, <=.
Graph Type BGate Value (a constant) or Attribute (a specific attribute from the plant structure).
Test ValueThe constant for the second operand (when Type B is Gate Value). Range 0-10.
Test AttributeThe attribute name for the second operand (when Type B is Attribute).

Snippet

ParameterDescription
Prune SnippetInline VEX for custom logic (f@height > 5, say).

Prune Cycle Settings

ParameterDescription
Test LifetimeNumber of iterations for pruning operations, allowing progressive refinement. Controls how many times the condition is re-evaluated for each internode. Range 0-10.
Start DelayTime delay (in steps / iterations) before pruning takes effect. Useful for allowing initial growth before evaluation begins. Range 0-10.

Notes

  • Prune re-evaluates conditions over multiple cycles, unlike Kill which acts immediately. This makes it suitable for gradual die-back behaviours.
  • For complex pruning logic, calculate custom attributes in a Wrangle upstream and use them as the test attribute in Prune.

See also: Simulation concept · Kill · Wrangle · Repeat