pub struct CubicBezier2d { /* private fields */ }Expand description
A cubic bezier curve
Implementations§
Source§impl CubicBezier2d
impl CubicBezier2d
Sourcepub const fn new(points: &[Point2d; 4]) -> Self
pub const fn new(points: &[Point2d; 4]) -> Self
Creates a new cubic bezier curve that passes through the provided control points.
Sourcepub fn line(start: Point2d, end: Point2d) -> Self
pub fn line(start: Point2d, end: Point2d) -> Self
Creates a cubic bezier curve which is a straight line passing through the given endpoints.
Sourcepub fn quadratic(points: &[Point2d; 3]) -> Self
pub fn quadratic(points: &[Point2d; 3]) -> Self
Creates a cubic bezier curve which is identical to the quadratic bezier curve that passes through the provided control points.
Sourcepub fn subdivide(&self, t: f64) -> [CubicBezier2d; 2]
pub fn subdivide(&self, t: f64) -> [CubicBezier2d; 2]
Subdivide the curve into two sub curves at the value t.
Trait Implementations§
Source§impl Clone for CubicBezier2d
impl Clone for CubicBezier2d
Source§fn clone(&self) -> CubicBezier2d
fn clone(&self) -> CubicBezier2d
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 CubicBezier2d
impl Debug for CubicBezier2d
Source§impl ParametricCurve2d for CubicBezier2d
impl ParametricCurve2d for CubicBezier2d
impl Copy for CubicBezier2d
Auto Trait Implementations§
impl Freeze for CubicBezier2d
impl RefUnwindSafe for CubicBezier2d
impl Send for CubicBezier2d
impl Sync for CubicBezier2d
impl Unpin for CubicBezier2d
impl UnwindSafe for CubicBezier2d
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