pub struct BezierPath { /* private fields */ }Expand description
A path is a set of Beziers that form a chain (i.e. the end of one is the start of the next)
Implementations§
Source§impl BezierPath
impl BezierPath
Sourcepub fn of_ellipse(
origin: Point,
radius: f64,
eccentricity: f64,
degrees: f64,
) -> Self
pub fn of_ellipse( origin: Point, radius: f64, eccentricity: f64, degrees: f64, ) -> Self
Create a set of paths that make an ellipse
Sourcepub fn of_points(corners: &[Point], rounding: f64) -> Self
pub fn of_points(corners: &[Point], rounding: f64) -> Self
Generate a set of Beziers that join the corners
Sourcepub fn round(&mut self, rounding: f64, closed: bool)
pub fn round(&mut self, rounding: f64, closed: bool)
Run through the path; for every adjacent pair of Beziers that are lines add an intermediate Bezier that is a rounded corner of the correct radius.
If the path is closed, thenn treat the first Bezier as adjacent to the last Bezier
Sourcepub fn add_bezier(&mut self, b: Bezier)
pub fn add_bezier(&mut self, b: Bezier)
Add a Bezier at the end of the path
Sourcepub fn apply_relief(&mut self, index: usize, straightness: f64, distance: f64)
pub fn apply_relief(&mut self, index: usize, straightness: f64, distance: f64)
Attempt to remove distance from the start or end of the path
but leave rest of path the same
Sourcepub fn iter_beziers(&self) -> impl Iterator<Item = &Bezier>
pub fn iter_beziers(&self) -> impl Iterator<Item = &Bezier>
Iterate through all the Beziers
Trait Implementations§
Source§impl Clone for BezierPath
impl Clone for BezierPath
Source§fn clone(&self) -> BezierPath
fn clone(&self) -> BezierPath
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BezierPath
impl Debug for BezierPath
Source§impl Default for BezierPath
impl Default for BezierPath
Source§fn default() -> BezierPath
fn default() -> BezierPath
Returns the “default value” for a type. Read more
Source§impl<Idx> Index<Idx> for BezierPathwhere
Idx: SliceIndex<[Bezier]>,
impl<Idx> Index<Idx> for BezierPathwhere
Idx: SliceIndex<[Bezier]>,
Auto Trait Implementations§
impl Freeze for BezierPath
impl RefUnwindSafe for BezierPath
impl Send for BezierPath
impl Sync for BezierPath
impl Unpin for BezierPath
impl UnwindSafe for BezierPath
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more