pub struct QuadBez {
pub p0: Point,
pub p1: Point,
pub p2: Point,
}
Expand description
A single quadratic Bézier segment.
Fields§
§p0: Point
§p1: Point
§p2: Point
Implementations§
Trait Implementations§
source§impl Mul<QuadBez> for TranslateScale
impl Mul<QuadBez> for TranslateScale
source§impl ParamCurve for QuadBez
impl ParamCurve for QuadBez
source§impl ParamCurveArclen for QuadBez
impl ParamCurveArclen for QuadBez
source§fn arclen(&self, _accuracy: f64) -> f64
fn arclen(&self, _accuracy: f64) -> f64
Arclength of a quadratic Bézier segment.
This computation is based on an analytical formula. Since that formula suffers from numerical instability when the curve is very close to a straight line, we detect that case and fall back to Legendre-Gauss quadrature.
Accuracy should be better than 1e-13 over the entire range.
Adapted from http://www.malczak.linuxpl.com/blog/quadratic-bezier-curve-length/ with permission.
source§impl ParamCurveArea for QuadBez
impl ParamCurveArea for QuadBez
source§fn signed_area(&self) -> f64
fn signed_area(&self) -> f64
Compute the signed area under the curve. Read more
source§impl ParamCurveCurvature for QuadBez
impl ParamCurveCurvature for QuadBez
source§impl ParamCurveDeriv for QuadBez
impl ParamCurveDeriv for QuadBez
source§impl ParamCurveExtrema for QuadBez
impl ParamCurveExtrema for QuadBez
source§fn extrema_ranges(&self) -> ArrayVec<Range<f64>, { _ }>
fn extrema_ranges(&self) -> ArrayVec<Range<f64>, { _ }>
Return parameter ranges, each of which is monotonic within the range.
source§fn bounding_box(&self) -> Rect
fn bounding_box(&self) -> Rect
The smallest rectangle that encloses the curve in the range (0..1).
source§impl ParamCurveNearest for QuadBez
impl ParamCurveNearest for QuadBez
source§impl Shape for QuadBez
impl Shape for QuadBez
source§type PathElementsIter<'iter> = QuadBezIter
type PathElementsIter<'iter> = QuadBezIter
The iterator returned by the
path_elements
method.source§fn path_elements(&self, _tolerance: f64) -> QuadBezIter ⓘ
fn path_elements(&self, _tolerance: f64) -> QuadBezIter ⓘ
source§fn bounding_box(&self) -> Rect
fn bounding_box(&self) -> Rect
The smallest rectangle that encloses the shape.
source§fn into_path(self, tolerance: f64) -> BezPathwhere
Self: Sized,
fn into_path(self, tolerance: f64) -> BezPathwhere
Self: Sized,
Convert into a Bézier path. Read more
source§fn path_segments(&self, tolerance: f64) -> Segments<Self::PathElementsIter<'_>> ⓘ
fn path_segments(&self, tolerance: f64) -> Segments<Self::PathElementsIter<'_>> ⓘ
source§fn as_rounded_rect(&self) -> Option<RoundedRect>
fn as_rounded_rect(&self) -> Option<RoundedRect>
If the shape is a rounded rectangle, make it available.
impl Copy for QuadBez
impl StructuralPartialEq for QuadBez
Auto Trait Implementations§
impl Freeze for QuadBez
impl RefUnwindSafe for QuadBez
impl Send for QuadBez
impl Sync for QuadBez
impl Unpin for QuadBez
impl UnwindSafe for QuadBez
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)