Struct lyon_bezier::QuadraticBezierSegment [] [src]

pub struct QuadraticBezierSegment {
    pub from: Point,
    pub ctrl: Point,
    pub to: Point,
}

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
[src]

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 bézier.

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.

Compute the length of the segment using a flattened approximation.

Trait Implementations

impl Copy for QuadraticBezierSegment
[src]

impl Clone for QuadraticBezierSegment
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for QuadraticBezierSegment
[src]

Formats the value using the given formatter.