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§
§impl Mul<QuadBez> for TranslateScale
impl Mul<QuadBez> for TranslateScale
§impl ParamCurve for QuadBez
impl ParamCurve for QuadBez
§fn subsegment(&self, range: Range<f64>) -> QuadBez
fn subsegment(&self, range: Range<f64>) -> QuadBez
Get a subsegment of the curve for the given parameter range.
§impl ParamCurveArclen for QuadBez
impl ParamCurveArclen for QuadBez
§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.
§impl ParamCurveArea for QuadBez
impl ParamCurveArea for QuadBez
§fn signed_area(&self) -> f64
fn signed_area(&self) -> f64
Compute the signed area under the curve. Read more
§impl ParamCurveCurvature for QuadBez
impl ParamCurveCurvature for QuadBez
§impl ParamCurveDeriv for QuadBez
impl ParamCurveDeriv for QuadBez
§impl ParamCurveExtrema for QuadBez
impl ParamCurveExtrema for QuadBez
§fn extrema(
&self
) -> ArrayVec<f64, kurbo::::quadbez::{impl#9}::extrema::{constant#0}>
fn extrema( &self ) -> ArrayVec<f64, kurbo::::quadbez::{impl#9}::extrema::{constant#0}>
Compute the extrema of the curve. Read more
§fn extrema_ranges(
&self
) -> ArrayVec<Range<f64>, kurbo::::param_curve::ParamCurveExtrema::extrema_ranges::{constant#0}>
fn extrema_ranges( &self ) -> ArrayVec<Range<f64>, kurbo::::param_curve::ParamCurveExtrema::extrema_ranges::{constant#0}>
Return parameter ranges, each of which is monotonic within the range.
§fn bounding_box(&self) -> Rect
fn bounding_box(&self) -> Rect
The smallest rectangle that encloses the curve in the range (0..1).
§impl ParamCurveNearest for QuadBez
impl ParamCurveNearest for QuadBez
§impl Shape for QuadBez
impl Shape for QuadBez
§type PathElementsIter = QuadBezIter
type PathElementsIter = QuadBezIter
The iterator returned by the
path_elements
method.§fn path_elements(&self, _tolerance: f64) -> QuadBezIter ⓘ
fn path_elements(&self, _tolerance: f64) -> QuadBezIter ⓘ
§fn bounding_box(&self) -> Rect
fn bounding_box(&self) -> Rect
The smallest rectangle that encloses the shape.
§fn path_segments(&self, tolerance: f64) -> Segments<Self::PathElementsIter<'_>> ⓘ
fn path_segments(&self, tolerance: f64) -> Segments<Self::PathElementsIter<'_>> ⓘ
§fn as_rounded_rect(&self) -> Option<RoundedRect>
fn as_rounded_rect(&self) -> Option<RoundedRect>
If the shape is a rounded rectangle, make it available.
§fn as_path_slice(&self) -> Option<&[PathEl]>
fn as_path_slice(&self) -> Option<&[PathEl]>
If the shape is stored as a slice of path elements, make
that available. Read more
impl Copy for QuadBez
impl StructuralPartialEq for QuadBez
Auto Trait Implementations§
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> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> RoundFrom<T> for T
impl<T> RoundFrom<T> for T
§fn round_from(x: T) -> T
fn round_from(x: T) -> T
Performs the conversion.
§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere U: RoundFrom<T>,
§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.