Studio Yotsuba
Back to Node List

Branching Path

branching_path

Generate deterministic branching paths for cracks, lightning, roots, veins, rivers, and impact lines

Reviewed
Guide available

Output Ports

NameTypeDescription
Path
path
Path
Ordinary Path document with each generated branch stored as an open sub-path

Parameters

NameTypeDefaultRangeDescription / Options
Width
width
Int
641–1024

Canvas width in pixels

Height
height
Int
641–1024

Canvas height in pixels

Layout
mode
Enum
Radial—

Choose a full radial burst or a fan aimed in one direction

  • RadialRadial
    Distribute the main branches evenly around the origin; useful for impact cracks, roots, and burst lines
  • DirectionalDirectional
    Aim the main branches inside one directional fan; useful for lightning, rivers, trunks, and veins
Origin X
origin_x
Int
320–1024

Horizontal origin in canvas pixels. Values beyond the current width are clamped to the right edge.

Origin Y
origin_y
Int
320–1024

Vertical origin in canvas pixels. Values beyond the current height are clamped to the bottom edge.

Direction
direction
Float
2700–360 / step 1

Center direction of the fan: 0° right, 90° down, 180° left, 270° up. In Radial mode this rotates the first spoke.

Fan Width
direction_spread
Float
900–360 / step 5

Total angle covered by directional main branches. Use 20–45° for lightning or trunks, 90–180° for river deltas and veins.

Main Branches
main_branches
Int
51–32

Number of branches starting at the origin. Try 3–6 for cracks and roots, 1–3 for lightning or a trunk.

Main Length
main_length
Float
241–512 / step 1

Approximate length of each main branch in pixels before boundary handling. Start near one-third of the canvas size.

Bend Interval
bend_interval
Float
51–32 / step 1

Distance between direction changes and branch opportunities. Use 3–5px for jagged cracks, 6–12px for roots and rivers.

Bend
bend
Float
120–90 / step 1

Maximum random turn at each bend interval. Use 5–15° for natural roots, 20–40° for cracks and lightning, 0° for straight rays.

Branch Chance
branch_chance
Float
0.30–1 / step 0.05

Chance to create one child at each bend point. Start at 0.15–0.3 for sparse cracks and 0.4–0.6 for dense roots or veins.

Branch Angle
branch_angle
Float
455–170 / step 5

Angle between a child and its parent direction. Use 25–45° for roots or rivers and 45–75° for cracks and lightning forks.

Branch Generations
max_generation
Int
20–6

How many child generations may grow after the main branches. Use 0 for spokes, 1–2 for game-size cracks, and 3+ only with a low chance or strict branch limit.

Child Length Ratio
length_decay
Float
0.60.1–0.95 / step 0.05

Child length relative to its parent. Use 0.5–0.7 for readable hierarchy; values near 0.9 create dense, similarly long branches.

Branch Limit
max_branches
Int
1281–512

Safety limit for logical branches. Lower it to 32–64 while tuning dense graphs; the node warns when the limit stops further growth.

Canvas Boundary
boundary
Enum
Stop—

Use Stop for isolated effects and Wrap for seamless tiles. Wrap may create multiple sub-path pieces for one logical branch.

  • StopStop
    Clip each branch at the first canvas edge it reaches
  • WrapWrap
    Continue from the opposite edge and split the Path there so no line crosses the canvas interior
Surface Role
surface_role
Enum
Default—

Optional S4 role metadata. This does not set line thickness or taper; control appearance downstream with Path Stroke or A30 curves.

  • DefaultDefault
    Leave role metadata empty for ordinary strokes and later editing
  • RaiseRaise
    Mark branches as raised tubes when connected to a Surface path input
  • CarveCarve
    Mark branches as carved grooves for cracks and river cuts
  • RidgeRidge
    Mark branches as narrow ridges for roots, veins, and raised seams
Seed
seed
Int
1-2147483648–2147483647

Changes bends, branch positions, and left/right choices. The same seed and settings always produce the same geometry and sub-path order.

Overview

Generates cracks, roots, impact lines, lightning, rivers, or leaf veins as ordinary paths. Because the result is not a specialized crack image, the same structure can feed line drawing, engraving, raised relief, or coordinate-map workflows. The seed fixes both the shape and generation order.

Usage tips

  • For crack line art, start with Radial, 3–6 main branches, 20–40° bend, 0.15–0.3 branch probability, and 1–2 generations, then use path_stroke at 1–2px with end taper.
  • For lightning, try Directional, 1–2 main branches, 20–45° direction spread, 25–40° bend, and 45–75° branch angle. Explore seeds, then preserve every parameter of the accepted shape.
  • For roots, veins, and rivers, try 6–12px between bends, 5–15° bend, and a child scale of 0.5–0.7. Raise branch probability before increasing generations.
  • For seamless tiles, use the boundary mode that continues on the opposite side. Logical branches are split at the edge, avoiding an unwanted line across the canvas center.
  • When feeding a Surface workflow, use cracks or channels as Carve and roots or veins as Ridge/Raise. Set width, height, and taper downstream.
  • A branch limit around 32–64 is a safe editing range. If a warning appears, lower branch probability or generations before raising the limit.

Common mistakes

  • The result becomes a black mass: halve branch probability, reduce generations by one, or increase the distance between bends.
  • Branches stop too soon: Stop at edge has reached the canvas boundary. Move the origin or direction inward, shorten the branch, or use wrapping only for tile assets.
  • Almost no child branches appear: a main branch shorter than the bend interval has no intermediate branch checks. Increase its length or reduce the interval.
  • The same seed produces a different shape: bend spacing, counts, limits, and other parameters also affect random-consumption order. Save the complete parameter set.
  • Wrapping increases the subpath count: this is intentional; edge fragments prevent a line from crossing the whole image.

Related nodes

  • path_stroke — apply width, color, and taper
  • path_smooth — reduce small bends after generation
  • path_coordinate_map — render progress, lateral distance, and subpath IDs
  • path_connect — join the generated result to a hand-drawn path
  • layers_to_surface — convert tagged branches into carved or raised detail
  • region_to_paths — extracts Region boundaries instead of growing branches from an origin
Back to Node List