[−]Struct piet_common::kurbo::CubicBez
A single cubic Bézier segment.
Fields
p0: Pointp1: Pointp2: Pointp3: PointMethods
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.
Trait Implementations
impl ParamCurveArea for CubicBez
fn signed_area(&self) -> f64
impl ParamCurveArclen for CubicBez
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.
fn inv_arclen(&self, arclen: f64, accuracy: f64) -> f64
Solve for the parameter that has the given arclength from the start. Read more
impl ParamCurveNearest for CubicBez
impl Debug for CubicBez
impl Mul<CubicBez> for Affine
type Output = CubicBez
The resulting type after applying the * operator.
fn mul(self, c: CubicBez) -> CubicBez
impl ParamCurveCurvature for CubicBez
impl ParamCurveExtrema for CubicBez
fn extrema(&self) -> ArrayVec<[f64; 4]>
fn extrema_ranges(&self) -> ArrayVec<[Range<f64>; 5]>
Return parameter ranges, each of which is monotonic within the range.
fn bounding_box(&self) -> Rect
The smallest rectangle that encloses the curve in the range (0..1).
impl ParamCurveDeriv for CubicBez
type DerivResult = QuadBez
fn deriv(&self) -> QuadBez
fn gauss_arclen(&self, coeffs: &[(f64, f64)]) -> f64
Estimate arclength using Gaussian quadrature. Read more
impl Clone for CubicBez
fn clone(&self) -> CubicBez
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl ParamCurve for CubicBez
fn eval(&self, t: f64) -> Point
fn start(&self) -> Point
fn end(&self) -> Point
fn subsegment(&self, range: Range<f64>) -> CubicBez
fn subdivide(&self) -> (CubicBez, CubicBez)
Subdivide into halves, using de Casteljau.
impl Copy for CubicBez
Auto Trait Implementations
Blanket Implementations
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> From<T> for 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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> RoundFrom<T> for T[src]
fn round_from(x: T) -> T[src]
impl<T, U> RoundInto<U> for T where
U: RoundFrom<T>, [src]
U: RoundFrom<T>,