Skip to content

Path Delete

Filter whole sub-paths out of a Shape based on a per-path attribute or a scalar field sampled at each path's centroid. Companion to PointDelete — operates at the path level (drops a full glyph, fill region, etc.) instead of the vertex level.

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

Ports

PortTypeDirectionDescription
shape_inshapeinputSource shape — output drops a subset of its sub-paths
mask_inscalarFieldinputOptional scalar field. When connected, sampled at each path's centroid for the delete decision
outshapeoutputShape with deleted paths removed and orphaned vertices garbage-collected

Parameters

ParamTypeDefaultDescription
attributestringglyphIndexPer-path attribute name to read when mask_in isn't connected. Defaults to glyphIndex (set by TextToShape) since text glyph filtering is the canonical use case
thresholdscalar0.5Cutoff for the delete decision. A path is deleted when its mask value is greater than threshold
invertbooleanfalseFlip the comparison — when on, paths are deleted when mask ≤ threshold

How It Works

For each sub-path in the input shape, PathDelete computes a single scalar mask value, then decides keep-vs-delete based on threshold. The result is a new shape containing only the kept paths.

Mask source priority:

  1. If mask_in is connected → sample the scalar field at the path's centroid (average of all referenced vertex positions).
  2. Otherwise → read path.attributes[attribute] (the per-path attribute map, as written by ShapeAttributes or by source nodes like TextToShape and VectorSource).
  3. Missing → 0.0 (path is kept by default).

Topology: Whole sub-paths are removed atomically — vertices, control points, and per-path attributes go together. Vertices that are no longer referenced by any surviving path are garbage-collected (along with their per-vertex attribute entries) so downstream ShapeToPoints / ShapeAttributes don't see dangling points.

Difference from PointDelete

PointDeletePathDelete
Filtersindividual verticeswhole sub-paths
Attribute sourceshape.points.attributes (per-vertex)path.attributes (per-path)
Behavior on shape inputDeletes vertices, rewires segments around gaps (paths get jagged)Deletes whole paths, preserves internal geometry
Right tool for"wobble away specific points in a stroke", per-vertex attribute filtering"drop letters from text", "remove pieces from an SVG", glyph-level filtering

If you want to delete an entire glyph from TextToShape, use PathDeleteTextToShape writes glyphIndex at the per-path level. PointDelete would only see the per-vertex attribute map (which is empty for text glyphs) and would no-op.

Usage Examples

Delete the last N glyphs of a text string

Text → TextToShape → PathDelete (attribute=glyphIndex, threshold=N-0.5) → DrawShape. Each glyph has glyphIndex equal to its 0-based position; setting threshold to N - 0.5 deletes everything from glyph N onwards.

Animate text deletion

Keyframe the threshold param from -0.5 → totalGlyphs+0.5. The text appears to "type out" letter by letter (or use invert: true for "delete from the front"). Combine with TextAnimate for richer effects.

Drop SVG paths by name or color

VectorSource → ShapeAttributes (target=Custom, attribute=keepFlag, value-by-name) → PathDelete (attribute=keepFlag). Use ShapeAttributes to tag specific paths and then PathDelete to remove them.

Field-driven path filtering

DistanceField (from a shape) → PathDelete.mask_in. Each input path's centroid samples the field; paths in the field's "high" region get dropped. Sweep a moving distance source to reveal/hide pieces over time.

Trim a multi-path shape by region

Rectangle → ShapeBoolean ← Multi-path shape → PathDelete.mask_in (from a Gradient field). Useful for cutting boolean results into bands.

Tips

  • glyphIndex is the default attribute because text filtering is the most common case. For other inputs (VectorSource paths, ShapeAttributes-tagged paths), change attribute to whatever you've tagged.
  • Threshold of 0.5 works well for integer attributes like glyphIndex — values 0 and below are kept, 1 and above are deleted. Shift threshold by an integer to keep more/fewer paths.
  • Use invert for "keep only the front" — flips the comparison so smaller values are deleted.
  • Field masks sample at the path centroid only. For per-vertex precision (e.g., trimming an open path mid-stroke), use PointDelete instead — but expect topology rewiring.
  • The output preserves shape-level fill_rule and any shape-level attributes set via ShapeAttributes.
  • PathDelete is a pure shape transform — no rasterization, no GPU. Cost is O(paths × vertices_per_path).
  • PointDelete — vertex-level filter (rewires paths around deleted vertices)
  • TextToShape — emits glyph outlines tagged with glyphIndex per path
  • ShapeAttributes — set custom per-path attributes for PathDelete to filter on
  • ShapeExploder — explicitly peel one sub-path at a time (manual alternative)
  • DistanceField, Gradient — scalar field sources for mask_in

Caddis — professional motion design.