Struct lyon_geom::QuadraticBezierSegment [] [src]

pub struct QuadraticBezierSegment<S> {
    pub from: Point<S>,
    pub ctrl: Point<S>,
    pub to: Point<S>,
}

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<S: Scalar> QuadraticBezierSegment<S>
[src]

[src]

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

[src]

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

[src]

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

[src]

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

[src]

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

[src]

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

[src]

Swap the beginning and the end of the segment.

[src]

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

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

[src]

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

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

[src]

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

[src]

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

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

[src]

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

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

[src]

Return the x inflection point or None if this curve is x-monotonic.

[src]

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

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

[src]

Split this curve into two sub-curves.

[src]

Return the curve before the split point.

[src]

Return the curve after the split point.

[src]

Elevate this curve to a third order bézier.

[src]

[src]

[src]

Computes a "fat line" of this segment.

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

[src]

Applies the transform to this curve and returns the results.

[src]

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

[src]

Iterates through the curve invoking a callback at each point.

[src]

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

[src]

Compute the length of the segment using a flattened approximation.

[src]

Returns a triangle containing this curve segment.

[src]

Returns a conservative rectangle that contains the curve.

[src]

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

[src]

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

[src]

Returns the smallest rectangle the curve is contained in

[src]

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

[src]

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

[src]

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

[src]

Returns whether this segment is monotonic on the x axis.

[src]

Returns whether this segment is monotonic on the y axis.

[src]

Returns whether this segment is fully monotonic.

[src]

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.

[src]

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

[src]

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.

[src]

[src]

[src]

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

Trait Implementations

impl<S: Copy> Copy for QuadraticBezierSegment<S>
[src]

impl<S: Clone> Clone for QuadraticBezierSegment<S>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<S: Debug> Debug for QuadraticBezierSegment<S>
[src]

[src]

Formats the value using the given formatter.

impl<S: PartialEq> PartialEq for QuadraticBezierSegment<S>
[src]

[src]

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

[src]

This method tests for !=.

impl<S: Scalar> Segment for QuadraticBezierSegment<S>
[src]

[src]

Start of the curve.

[src]

End of the curve.

[src]

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

[src]

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

[src]

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

[src]

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

[src]

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

[src]

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

[src]

Split this curve into two sub-curves.

[src]

Return the curve before the split point.

[src]

Return the curve after the split point.

[src]

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

[src]

Swap the direction of the segment.

[src]

Compute the length of the segment using a flattened approximation.

impl<S: Scalar> FlatteningStep for QuadraticBezierSegment<S>
[src]

[src]

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

[src]

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