Struct kurbo::CubicBez[][src]

pub struct CubicBez {
    pub p0: Point,
    pub p1: Point,
    pub p2: Point,
    pub p3: Point,
}

A single cubic Bézier segment.

Fields

p0: Pointp1: Pointp2: Pointp3: Point

Implementations

impl CubicBez[src]

pub fn new<P: Into<Point>>(p0: P, p1: P, p2: P, p3: P) -> CubicBez[src]

Create a new cubic Bézier segment.

pub fn to_quads(
    &self,
    accuracy: f64
) -> impl Iterator<Item = (f64, f64, QuadBez)>
[src]

Convert to quadratic Béziers.

The iterator returns the start and end parameter in the cubic of each quadratic segment, along with the quadratic.

Note that the resulting quadratic Béziers are not in general G1 continuous; they are optimized for minimizing distance error.

This iterator will always produce at least one QuadBez.

pub fn is_finite(&self) -> bool[src]

Is this cubic Bezier curve finite?

pub fn is_nan(&self) -> bool[src]

Is this cubic Bezier curve NaN?

Trait Implementations

impl Clone for CubicBez[src]

impl Copy for CubicBez[src]

impl Debug for CubicBez[src]

impl<'de> Deserialize<'de> for CubicBez[src]

impl From<CubicBez> for PathSeg[src]

impl Mul<CubicBez> for Affine[src]

type Output = CubicBez

The resulting type after applying the * operator.

impl Mul<CubicBez> for TranslateScale[src]

type Output = CubicBez

The resulting type after applying the * operator.

impl ParamCurve for CubicBez[src]

fn subdivide(&self) -> (CubicBez, CubicBez)[src]

Subdivide into halves, using de Casteljau.

impl ParamCurveArclen for CubicBez[src]

fn arclen(&self, accuracy: f64) -> f64[src]

Arclength of a cubic Bézier segment.

This is an adaptive subdivision approach using Legendre-Gauss quadrature in the base case, and an error estimate to decide when to subdivide.

impl ParamCurveArea for CubicBez[src]

impl ParamCurveCurvature for CubicBez[src]

impl ParamCurveDeriv for CubicBez[src]

type DerivResult = QuadBez

The parametric curve obtained by taking the derivative of this one.

impl ParamCurveExtrema for CubicBez[src]

impl ParamCurveNearest for CubicBez[src]

fn nearest(&self, p: Point, accuracy: f64) -> Nearest[src]

Find nearest point, using subdivision.

impl PartialEq<CubicBez> for CubicBez[src]

impl Serialize for CubicBez[src]

impl Shape for CubicBez[src]

type PathElementsIter = CubicBezIter

The iterator returned by the path_elements method. Read more

impl StructuralPartialEq for CubicBez[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.