[−]Struct druid::piet::kurbo::CubicBez
A single cubic Bézier segment.
Fields
p0: Point
p1: Point
p2: Point
p3: Point
Implementations
impl CubicBez
pub fn new<P>(p0: P, p1: P, p2: P, p3: P) -> CubicBez where
P: Into<Point>,
P: Into<Point>,
Create a new cubic Bézier segment.
pub fn to_quads(
&self,
accuracy: f64
) -> impl Iterator<Item = (f64, f64, QuadBez)>
&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
.
Trait Implementations
impl Clone for CubicBez
pub fn clone(&self) -> CubicBez
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for CubicBez
impl Data for CubicBez
[src]
impl Debug for CubicBez
impl From<CubicBez> for PathSeg
impl Mul<CubicBez> for TranslateScale
type Output = CubicBez
The resulting type after applying the *
operator.
pub fn mul(self, other: CubicBez) -> CubicBez
impl Mul<CubicBez> for Affine
type Output = CubicBez
The resulting type after applying the *
operator.
pub fn mul(self, c: CubicBez) -> CubicBez
impl ParamCurve for CubicBez
pub fn eval(&self, t: f64) -> Point
pub fn start(&self) -> Point
pub fn end(&self) -> Point
pub fn subsegment(&self, range: Range<f64>) -> CubicBez
pub fn subdivide(&self) -> (CubicBez, CubicBez)
Subdivide into halves, using de Casteljau.
impl ParamCurveArclen for CubicBez
pub fn arclen(&self, accuracy: f64) -> f64
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.
pub fn inv_arclen(&self, arclen: f64, accuracy: f64) -> f64
impl ParamCurveArea for CubicBez
pub fn signed_area(&self) -> f64
impl ParamCurveCurvature for CubicBez
impl ParamCurveDeriv for CubicBez
type DerivResult = QuadBez
The parametric curve obtained by taking the derivative of this one.
pub fn deriv(&self) -> QuadBez
pub fn gauss_arclen(&self, coeffs: &[(f64, f64)]) -> f64
impl ParamCurveExtrema for CubicBez
pub fn extrema(&self) -> ArrayVec<[f64; 4]>
pub fn extrema_ranges(&self) -> ArrayVec<[Range<f64>; 5]>
pub fn bounding_box(&self) -> Rect
impl ParamCurveNearest for CubicBez
impl PartialEq<CubicBez> for CubicBez
impl Shape for CubicBez
type PathElementsIter = CubicBezIter
The iterator returned by the path_elements
method. Read more
pub fn path_elements(&self, _tolerance: f64) -> CubicBezIterⓘNotable traits for CubicBezIter
impl Iterator for CubicBezIter type Item = PathEl;
Notable traits for CubicBezIter
impl Iterator for CubicBezIter type Item = PathEl;
pub fn area(&self) -> f64
pub fn perimeter(&self, accuracy: f64) -> f64
pub fn winding(&self, _pt: Point) -> i32
pub fn bounding_box(&self) -> Rect
pub fn to_path(&self, tolerance: f64) -> BezPath
pub fn into_path(self, tolerance: f64) -> BezPath
pub fn path_segments(&self, tolerance: f64) -> Segments<Self::PathElementsIter>ⓘ
pub fn contains(&self, pt: Point) -> bool
pub fn as_line(&self) -> Option<Line>
pub fn as_rect(&self) -> Option<Rect>
pub fn as_rounded_rect(&self) -> Option<RoundedRect>
pub fn as_circle(&self) -> Option<Circle>
pub fn as_path_slice(&self) -> Option<&[PathEl]>
impl StructuralPartialEq for CubicBez
Auto Trait Implementations
impl RefUnwindSafe for CubicBez
[src]
impl Send for CubicBez
[src]
impl Sync for CubicBez
[src]
impl Unpin for CubicBez
[src]
impl UnwindSafe for CubicBez
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> AnyEq for T where
T: PartialEq<T> + Any,
[src]
T: PartialEq<T> + Any,
pub fn equals(&self, other: &(dyn Any + 'static)) -> bool
[src]
pub fn as_any(&self) -> &(dyn Any + 'static)
[src]
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> RoundFrom<T> for T
pub fn round_from(x: T) -> T
impl<T, U> RoundInto<U> for T where
U: RoundFrom<T>,
U: RoundFrom<T>,
pub fn round_into(self) -> U
impl<T> Same<T> for T
type Output = T
Should always be Self
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>,