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).

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

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

Sample the y coordinate of the curve's derivative 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.

Find the advancement of the y-least 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.

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

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

Find the advancement of the x-least position in the curve.

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

Return the x inflection point or None if this curve is x-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.

Applies the transform to this curve and returns the results.

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.

Returns a triangle containing this curve segment.

Returns a rectangle the curve is contained in

Returns the smallest rectangle the curve is contained in

Cast this curve into a x-montone curve without checking that the monotonicity assumption is correct.

Cast this curve into a y-montone curve without checking that the monotonicity assumption is correct.

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.