pub struct CubicBezier {
pub p0: Point2D,
pub p1: Point2D,
pub p2: Point2D,
pub p3: Point2D,
}Expand description
Bezier curve segment.
Fields§
§p0: Point2DStart point
p1: Point2DFirst control point
p2: Point2DSecond control point
p3: Point2DEnd point
Implementations§
Source§impl CubicBezier
impl CubicBezier
Sourcepub const fn new(p0: Point2D, p1: Point2D, p2: Point2D, p3: Point2D) -> Self
pub const fn new(p0: Point2D, p1: Point2D, p2: Point2D, p3: Point2D) -> Self
Create a new cubic Bezier curve.
Sourcepub fn to_polyline(&self, segments: usize) -> Vec<Point2D>
pub fn to_polyline(&self, segments: usize) -> Vec<Point2D>
Convert to a polyline with given number of segments.
Sourcepub fn arc_length(&self, segments: usize) -> f64
pub fn arc_length(&self, segments: usize) -> f64
Compute approximate arc length.
Trait Implementations§
Source§impl Clone for CubicBezier
impl Clone for CubicBezier
Source§fn clone(&self) -> CubicBezier
fn clone(&self) -> CubicBezier
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 CubicBezier
impl Debug for CubicBezier
Source§impl PartialEq for CubicBezier
impl PartialEq for CubicBezier
impl Copy for CubicBezier
impl StructuralPartialEq for CubicBezier
Auto Trait Implementations§
impl Freeze for CubicBezier
impl RefUnwindSafe for CubicBezier
impl Send for CubicBezier
impl Sync for CubicBezier
impl Unpin for CubicBezier
impl UnwindSafe for CubicBezier
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more