pub struct BezPath(_);
Expand description
A path that can Bézier segments up to cubic, possibly with multiple subpaths.
Implementations§
source§impl BezPath
impl BezPath
sourcepub fn curveto<V: Into<Vec2>>(&mut self, p1: V, p2: V, p3: V)
pub fn curveto<V: Into<Vec2>>(&mut self, p1: V, p2: V, p3: V)
Push a curveto element onto the path.
sourcepub fn segments<'a>(&'a self) -> impl Iterator<Item = (usize, PathSeg)> + 'a
pub fn segments<'a>(&'a self) -> impl Iterator<Item = (usize, PathSeg)> + 'a
Iterate over the path segments.
The iterator returns the index within the path and the segment.
sourcepub fn apply_affine(&mut self, affine: Affine)
pub fn apply_affine(&mut self, affine: Affine)
Apply an affine transform to the path.
sourcepub fn arclen(&self, accuracy: f64) -> f64
pub fn arclen(&self, accuracy: f64) -> f64
Compute the total arclength.
Here, accuracy
specifies the accuracy for each Bézier segment. At worst,
the total error is accuracy
times the number of Bézier segments.
Note: this is one of the methods that could be implemented on an iterator
of PathEl
, to save allocation.