[−][src]Struct kurbo::CubicBez
A single cubic Bézier segment.
Fields
p0: Vec2
p1: Vec2
p2: Vec2
p3: Vec2
Methods
impl CubicBez
[src]
pub fn new<V: Into<Vec2>>(p0: V, p1: V, p2: V, p3: V) -> 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.
Trait Implementations
impl ParamCurve for CubicBez
[src]
fn eval(&self, t: f64) -> Vec2
[src]
fn start(&self) -> Vec2
[src]
fn end(&self) -> Vec2
[src]
fn subsegment(&self, range: Range<f64>) -> CubicBez
[src]
fn subdivide(&self) -> (CubicBez, CubicBez)
[src]
Subdivide into halves, using de Casteljau.
impl ParamCurveDeriv for CubicBez
[src]
type DerivResult = QuadBez
fn deriv(&self) -> QuadBez
[src]
fn gauss_arclen(&self, coeffs: &[(f64, f64)]) -> f64
[src]
Estimate arclength using Gaussian quadrature. Read more
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]
Solve for the parameter that has the given arclength from the start. Read more
impl ParamCurveArea for CubicBez
[src]
fn signed_area(&self) -> f64
[src]
impl ParamCurveNearest for CubicBez
[src]
impl ParamCurveCurvature for CubicBez
[src]
impl ParamCurveExtrema for CubicBez
[src]
fn extrema(&self) -> ArrayVec<[f64; 4]>
[src]
fn extrema_ranges(&self) -> ArrayVec<[Range<f64>; 5]>
[src]
Return parameter ranges, each of which is monotonic within the range.
fn bounding_box(&self) -> Rect
[src]
The smallest rectangle that encloses the curve in the range (0..1).
impl Copy for CubicBez
[src]
impl Clone for CubicBez
[src]
fn clone(&self) -> CubicBez
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Mul<CubicBez> for Affine
[src]
type Output = CubicBez
The resulting type after applying the *
operator.
fn mul(self, c: CubicBez) -> CubicBez
[src]
impl Debug for CubicBez
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,