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
Graphicsfor 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. - Path
Builder - Builder for a
Path. Each method returnsSelffor chaining.
Enums§
- Path
Command - 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
toleranceof the chord. - flatten_
quad 🔒 - Adaptive flattening of a quadratic Bezier. Subdivides until the
control point is within
toleranceof the chord. - perp_
distance 🔒 - Perpendicular distance from
pto the line throughaandb.