Expand description
What an editor asks of shapes: where items are, which one is under a point, how long a path is, and paths cut, resampled, or converted. Each answer comes from the code the renderer draws with.
Inputs and outputs are normalized as the model is, on a picture of a given size; lengths and distances are in its pixels.
Structs§
- Nearest
- The point of a path nearest another.
Functions§
- from_
bez - A pixel path as vertices and tangents, normalized. Quadratic segments are raised to cubics; a closed subpath’s closing line back to its start is left implicit.
- hit_
test - The front-most fill or stroke that paints the normalized
point, by its fill rule (a stroke by its outline): the item’s place in the tree. - items
- Every item’s
ItemPath(place in the tree, device path, and bounds), in document order. - nearest_
point - The point of
pathnearest the normalizedpoint, measured in pixels. - path_
lengths - Each subpath’s length in pixels.
- resample_
path pathwithcounts[i]vertices on subpathi, spaced evenly along its pixel length, with tangents along the curve a third of the spacing long: paths of different vertex counts made ready to morph. A subpath with no count, or a count under 2 (3 when closed), is left as it is.- shape_
bounds - The normalized bounds of every item, in document order: geometry’s
outline, a paint’s area (a stroke’s with its width), a group’s items’.
Trims are not listed; an item with nothing to show has
None. - to_path
geometryas a path of the same outline, normalized: the editor’s “convert to path”.- trim_
path pathtrimmed as a trim item trims it, together: the kept span of its subpaths’ lengths in pixels, normalized again.