#[repr(C)]pub struct CubicSegment {
pub p0: Point,
pub p1: Point,
pub p2: Point,
pub p3: Point,
}
Expand description
A cubic bezier curve segment in 2-dimensional Euclidian space.
Fields§
§p0: Point
§p1: Point
§p2: Point
§p3: Point
Implementations§
Source§impl CubicSegment
impl CubicSegment
Sourcepub fn new(p0: Point, p1: Point, p2: Point, p3: Point) -> CubicSegment
pub fn new(p0: Point, p1: Point, p2: Point, p3: Point) -> CubicSegment
Creates a new cubic bezier curve segment with the given control points.
Sourcepub fn is_approximately_linear(self, epsilon: f64) -> bool
pub fn is_approximately_linear(self, epsilon: f64) -> bool
Returns true if self
is approximately linear with tolerance epsilon
.
Sourcepub fn split(self, t: f64) -> (CubicSegment, CubicSegment)
pub fn split(self, t: f64) -> (CubicSegment, CubicSegment)
Splits self
into two quadratic Bezier curve segments, at parameter t
.
Trait Implementations§
Source§impl Clone for CubicSegment
impl Clone for CubicSegment
Source§fn clone(&self) -> CubicSegment
fn clone(&self) -> CubicSegment
Returns a copy 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 CubicSegment
impl Debug for CubicSegment
Source§impl PartialEq for CubicSegment
impl PartialEq for CubicSegment
Source§impl Transform for CubicSegment
impl Transform for CubicSegment
fn transform<T>(self, t: &T) -> CubicSegmentwhere
T: Transformation,
fn transform_mut<T>(&mut self, t: &T)where
T: Transformation,
impl Copy for CubicSegment
impl StructuralPartialEq for CubicSegment
Auto Trait Implementations§
impl Freeze for CubicSegment
impl RefUnwindSafe for CubicSegment
impl Send for CubicSegment
impl Sync for CubicSegment
impl Unpin for CubicSegment
impl UnwindSafe for CubicSegment
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