Struct kurbo::CubicBez [−][src]
A single cubic Bézier segment.
Fields
p0: Point
p1: Point
p2: Point
p3: 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]
&self,
accuracy: f64
) -> impl Iterator<Item = (f64, f64, QuadBez)>
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]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl From<CubicBez> for PathSeg
[src]
impl Mul<CubicBez> for Affine
[src]
type Output = CubicBez
The resulting type after applying the *
operator.
fn mul(self, c: CubicBez) -> CubicBez
[src]
impl Mul<CubicBez> for TranslateScale
[src]
type Output = CubicBez
The resulting type after applying the *
operator.
fn mul(self, other: CubicBez) -> CubicBez
[src]
impl ParamCurve for CubicBez
[src]
fn eval(&self, t: f64) -> Point
[src]
fn start(&self) -> Point
[src]
fn end(&self) -> Point
[src]
fn subsegment(&self, range: Range<f64>) -> 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.
fn inv_arclen(&self, arclen: f64, accuracy: f64) -> f64
[src]
impl ParamCurveArea for CubicBez
[src]
fn signed_area(&self) -> f64
[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.
fn deriv(&self) -> QuadBez
[src]
fn gauss_arclen(&self, coeffs: &[(f64, f64)]) -> f64
[src]
impl ParamCurveExtrema for CubicBez
[src]
fn extrema(&self) -> ArrayVec<[f64; 4]>
[src]
fn extrema_ranges(&self) -> ArrayVec<[Range<f64>; 5]>
[src]
fn bounding_box(&self) -> Rect
[src]
impl ParamCurveNearest for CubicBez
[src]
impl PartialEq<CubicBez> for CubicBez
[src]
impl Serialize for CubicBez
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl Shape for CubicBez
[src]
type PathElementsIter = CubicBezIter
The iterator returned by the path_elements
method. Read more
fn path_elements(&self, _tolerance: f64) -> CubicBezIterⓘNotable traits for CubicBezIter
impl Iterator for CubicBezIter type Item = PathEl;
[src]
Notable traits for CubicBezIter
impl Iterator for CubicBezIter type Item = PathEl;
fn area(&self) -> f64
[src]
fn perimeter(&self, accuracy: f64) -> f64
[src]
fn winding(&self, _pt: Point) -> i32
[src]
fn bounding_box(&self) -> Rect
[src]
fn to_path(&self, tolerance: f64) -> BezPath
[src]
fn into_path(self, tolerance: f64) -> BezPath
[src]
fn path_segments(&self, tolerance: f64) -> Segments<Self::PathElementsIter>ⓘ
[src]
fn contains(&self, pt: Point) -> bool
[src]
fn as_line(&self) -> Option<Line>
[src]
fn as_rect(&self) -> Option<Rect>
[src]
fn as_rounded_rect(&self) -> Option<RoundedRect>
[src]
fn as_circle(&self) -> Option<Circle>
[src]
fn as_path_slice(&self) -> Option<&[PathEl]>
[src]
impl StructuralPartialEq for CubicBez
[src]
Auto Trait Implementations
impl RefUnwindSafe for CubicBez
impl Send for CubicBez
impl Sync for CubicBez
impl Unpin for CubicBez
impl UnwindSafe for CubicBez
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,