Expand description
A single cubic Bézier segment.
Fields§
§p0: Vec2
§p1: Vec2
§p2: Vec2
§p3: Vec2
Implementations§
source§impl CubicBez
impl CubicBez
sourcepub fn new<V: Into<Vec2>>(p0: V, p1: V, p2: V, p3: V) -> CubicBez
pub fn new<V: Into<Vec2>>(p0: V, p1: V, p2: V, p3: V) -> CubicBez
Create a new cubic Bézier segment.
sourcepub fn to_quads(
&self,
accuracy: f64
) -> impl Iterator<Item = (f64, f64, QuadBez)>
pub fn to_quads(
&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§
source§impl ParamCurve for CubicBez
impl ParamCurve for CubicBez
source§impl ParamCurveArclen for CubicBez
impl ParamCurveArclen for CubicBez
source§impl ParamCurveArea for CubicBez
impl ParamCurveArea for CubicBez
source§fn signed_area(&self) -> f64
fn signed_area(&self) -> f64
Compute the signed area under the curve. Read more