Struct lyon::bezier::QuadraticBezierSegment [] [src]

pub struct QuadraticBezierSegment {
    pub from: TypedPoint2D<f32, UnknownUnit>,
    pub ctrl: TypedPoint2D<f32, UnknownUnit>,
    pub to: TypedPoint2D<f32, UnknownUnit>,
}

A 2d curve segment defined by three points: the beginning of the segment, a control point and the end of the segment.

The curve is defined by equation: ∀ t ∈ [0..1], P(t) = (1 - t)² * from + 2 * (1 - t) * t * ctrl + 2 * t * to

Fields

Methods

impl QuadraticBezierSegment

Sample the curve at t (expecting t between 0 and 1).

Sample the x coordinate of the curve at t (expecting t between 0 and 1).

Sample the y coordinate of the curve at t (expecting t between 0 and 1).

Swap the beginning and the end of the segment.

Find the advancement of the y-most position in the curve.

This returns the advancement along the curve, not the actual y position.

Return the y inflection point or None if this curve is y-monotone.

Split this curve into two sub-curves.

Return the curve before the split point.

Return the curve after the split point.

Elevate this curve to a third order bezier.

Find the interval of the begining of the curve that can be approximated with a line segment.

Iterates through the curve invoking a callback at each point.

Returns the flattened representation of the curve as an iterator, starting after the current point.

Trait Implementations

impl Copy for QuadraticBezierSegment

impl Debug for QuadraticBezierSegment

impl Clone for QuadraticBezierSegment