Struct lyon::bezier::CubicBezierSegment [] [src]

pub struct CubicBezierSegment {
    pub from: TypedPoint2D<f32, UnknownUnit>,
    pub ctrl1: TypedPoint2D<f32, UnknownUnit>,
    pub ctrl2: TypedPoint2D<f32, UnknownUnit>,
    pub to: TypedPoint2D<f32, UnknownUnit>,
}

A 2d curve segment defined by four points: the beginning of the segment, two control points and the end of the segment.

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

Fields

Methods

impl CubicBezierSegment

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

Split this curve into two sub-curves.

Return the curve before the split point.

Return the curve after the split point.

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

Iterates through the curve invoking a callback at each point.

Trait Implementations

impl Copy for CubicBezierSegment

impl Debug for CubicBezierSegment

impl Clone for CubicBezierSegment