Skip to content

Trim Path

Arc-length carving that preserves point identity. Existing vertices stay put; new vertices only appear at the trim boundaries.

Category: Shape Ops Menu path: Shape Ops > Trim Path

Ports

PortTypeDirectionDescription
shape_inshapeinputSource shape to trim
outshapeoutputTrimmed shape

Parameters

ParamTypeDefaultDescription
startscalar0.0Start of the visible range (normalized 0 to 1 along path arc length)
endscalar1.0End of the visible range (normalized 0 to 1)
offsetscalar0.0Shifts the visible window along the path. For closed paths it wraps around.
modeenumIndividuallyIndividually = each path trimmed independently; Simultaneously = all paths trim in lockstep as one combined length
delayAttributestring""Optional per-path scalar attribute name. When set, each path's trim window shifts by -path.attributes[delayAttribute], letting a multi-path shape stagger through the same global animation. Used with ShapeAttributes (target: Custom, source: Index) upstream for per-path-order stagger, or a Field source for spatial stagger (plant branches delayed higher up, etc.). Empty (default) ignores it. Only meaningful in Simultaneously mode.

Expose Channels

When enabled (E button on node header), adds input ports that override params via edge connections:

PortTypeOverrides
start_inscalarstart
end_inscalarend
offset_inscalaroffset

How It Works

TrimPath walks each path by arc length and keeps only the portion between start and end (after applying offset). The key distinction from traditional path trimming: existing vertices stay where they are. New vertices are only added at the exact trim boundaries — everything else carries its original position, attributes, and tangents.

That point-preservation is why TrimPath composes differently depending on where you put it in the graph:

  • Resample → TrimPath — the resampled points are fixed in place. As you animate end from 0 to 1, new points appear along the path as the trim sweeps through. Any downstream PointAttributes or PointDeform noise displacement grows into view alongside the trim. This is how you build a stem-growing-out-of-the-ground animation.
  • TrimPath → Resample — resampling runs on the already-trimmed path, so the point count is constant and they slide along the curve as the trim moves. This gives a smooth sliding effect rather than an appearing one.

Mode:

  • Individually (default) — each path in the shape trims its own range independently. Two separate lines both grow from their own starts.
  • Simultaneously — all paths are joined end-to-end into one virtual arc length. The trim moves through them in order, so only the first path is visible during the early part of the animation, then the second, and so on.

Closed paths wrap around the seam. An offset of 0.5 on a closed circle shifts the visible window halfway around. When the visible range covers the full perimeter, TrimPath emits the result as a closed path.

Per-path trim attribute (Parallel/Simultaneously mode only): if an upstream node writes a scalar path-level attribute named trim, that value overrides the uniform end param for that specific path — each path ends up with its own trim amount. The natural source is ShapeAttributes(Custom "trim", source=Field) applied before the cloning step: drive trim via a Noise field and each clone ends up at a different length. Leave the node's end param at 1.0 so unattributed paths render fully. Paths with trim=0 are skipped entirely.

Usage Examples

Basic: Line write-on

EditableShape (draw a signature) -> TrimPath (animate end from 0 to 1) -> DrawShape. The line draws on from start to finish.

Stem growing out of the ground

Line -> ResampleShape (count: 64) -> TrimPath (animate end from 0 to 1) -> ShapeDeform (field: Noise.vectorField, low amplitude) -> DrawShape. The resampled points are fixed, so the noise displacement appears along the stem as the trim reveals it — giving the impression of a stem growing upward through a noise field.

Dandelion: Stem with branches on top

Combine the stem above with ShapeAttributes (Rotation, source: Tangent) on the shape feeding CloneToPoints (pivotMode: FirstPoint, shape: thin Rectangle). As the trim animates and new points appear at the top of the stem, clones of the branch appear rotated to match the curve tangent.

Dashed line animation

Circle -> TrimPath (animate offset, keep start=0 end=0.2) -> DrawShape. A 20% arc visible, marching around the circle.

Multi-path reveal

Text -> TextToShape -> TrimPath (mode: Simultaneously, animate end from 0 to 1) -> DrawShape. Letters appear one after the other as if being written in order.

Tips

  • start, end, and offset are normalized to each path's arc length — a value of 0.5 means "halfway along". This keeps the node resolution-independent and uniform across paths of different lengths.
  • Resample → Trim vs Trim → Resample is the main creative decision. The first grows into view, the second slides.
  • For closed paths, animating offset instead of end produces a marching segment that wraps around the seam without any pop.
  • TrimPath preserves per-vertex attributes where possible — vertices that survive the cut keep their original attribute values, and new boundary vertices interpolate between neighbors.
  • TrimPath runs in the value pre-pass for accurate overscan bounds, so there's no cost difference between downstream effects running before or after.
  • ResampleShape — partner for the grow-on vs slide workflow
  • ShapeDeform — noise displacement that naturally composes with a growing trim
  • ShapeAttributes — Tangent rotation along a trimmed stem for aligned clones
  • CloneToPoints — place shapes at the trimmed path's points as they appear
  • DrawShape — rasterize the trimmed result