Skip to main content

Module path

Module path 

Source
Expand description

Path commands + adaptive Bezier flattening (M-VEC.10 / AUT-62).

Supports move_to, line_to, quad_to, cubic_to, close. Two consumer paths:

  • Flatten to a polygon for masking via crate::scene::VectorShape::Path.
  • Render as a stroked Graphics for visible arrow / freehand geometry (joins between segments are butt-style for V1; mitered joins are a future enhancement).

Adaptive subdivision uses a flatness test on the control polygon: a Bezier curve is “flat enough” when the maximum perpendicular distance from a control point to the chord is below tolerance.

Boolean ops on paths (union, intersection, difference, xor) live in the boolean submodule (M-BOOL.0 / AUT-161).

Modules§

boolean
Path boolean ops (M-BOOL.0 / AUT-161 → M-BOOL.5 / AUT-166).

Structs§

Path
Owned path data — list of PathCommands plus consumer methods.
PathBuilder
Builder for a Path. Each method returns Self for chaining.

Enums§

PathCommand
One command in a path. The path is a sequence of these; rendering / flattening walks them in order.

Functions§

flatten_cubic 🔒
Adaptive flattening of a cubic Bezier — same idea, subdivide until both control points are within tolerance of the chord.
flatten_quad 🔒
Adaptive flattening of a quadratic Bezier. Subdivides until the control point is within tolerance of the chord.
perp_distance 🔒
Perpendicular distance from p to the line through a and b.