Struct lyon::geom::CubicBezierSegment []

pub struct CubicBezierSegment<S> {
    pub from: TypedPoint2D<S, UnknownUnit>,
    pub ctrl1: TypedPoint2D<S, UnknownUnit>,
    pub ctrl2: TypedPoint2D<S, UnknownUnit>,
    pub to: TypedPoint2D<S, 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<S> CubicBezierSegment<S> where
    S: Scalar, 

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

Return the sub-curve inside a given range of t.

This is equivalent splitting at the range's end points.

Split this curve into two sub-curves.

Return the curve before the split point.

Return the curve after the split point.

Computes a "fat line" of this segment.

A fat line is two convervative lines between which the segment is fully contained.

Applies the transform to this curve and returns the results.

Swap the beginning and the end of the segment.

Important traits for Flattened<S>

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

Invokes a callback between each monotonic part of the segment.

Invokes a callback for each monotonic part of the segment..

Approximates the cubic bézier curve with sequence of quadratic ones, invoking a callback at each step.

Approximates the cubic bézier curve with sequence of monotonic quadratic ones, invoking a callback at each step.

Iterates through the curve invoking a callback at each point.

Compute the length of the segment using a flattened approximation.

Return local x extrema or None if this curve is monotonic.

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

Return local y extrema or None if this curve is monotonic.

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

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.

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 x-least position in the curve.

Returns a conservative rectangle the curve is contained in.

This method is faster than bounding_rect but more conservative.

Returns a conservative range of x this curve is contained in.

Returns a conservative range of y this curve is contained in.

Returns the smallest rectangle the curve is contained in

Returns the smallest range of x this curve is contained in.

Returns the smallest range of y this curve is contained in.

Cast this curve into a monotonic curve without checking that the monotonicity assumption is correct.

Returns whether this segment is monotonic on the x axis.

Returns whether this segment is monotonic on the y axis.

Returns whether this segment is fully monotonic.

Important traits for ArrayVec<A>

Computes the intersections (if any) between this segment a line.

The result is provided in the form of the t parameters of each point along curve. To get the intersection points, sample the curve at the corresponding values.

Important traits for ArrayVec<A>

Important traits for ArrayVec<A>

Computes the intersections (if any) between this segment a line segment.

The result is provided in the form of the t parameters of each point along curve and segment. To get the intersection points, sample the segments at the corresponding values.

Important traits for ArrayVec<A>

Trait Implementations

impl<S> FlattenedForEach for CubicBezierSegment<S> where
    S: Scalar, 

Iterates through the curve invoking a callback at each point.

impl<S> Copy for CubicBezierSegment<S> where
    S: Copy

impl<S> PartialEq<CubicBezierSegment<S>> for CubicBezierSegment<S> where
    S: PartialEq<S>, 

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<S> Segment for CubicBezierSegment<S> where
    S: Scalar, 

Start of the curve.

End of the curve.

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

Sample x at t (expecting t between 0 and 1).

Sample y at t (expecting t between 0 and 1).

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

Sample x derivative at t (expecting t between 0 and 1).

Sample y derivative 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.

Return the curve inside a given range of t. Read more

Swap the direction of the segment.

Compute the length of the segment using a flattened approximation.

impl<S> Clone for CubicBezierSegment<S> where
    S: Clone

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<S> Debug for CubicBezierSegment<S> where
    S: Debug

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<S> Send for CubicBezierSegment<S> where
    S: Send

impl<S> Sync for CubicBezierSegment<S> where
    S: Sync