Struct lyon::geom::LineSegment []

pub struct LineSegment<S> {
    pub from: TypedPoint2D<S, UnknownUnit>,
    pub to: TypedPoint2D<S, UnknownUnit>,
}

A linear segment.

Fields

Methods

impl<S> LineSegment<S> where
    S: Scalar, 

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

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

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

Returns an inverted version of this segment where the beginning and the end points are swapped.

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

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

Split this curve into two sub-segments.

Return the segment before the split point.

Return the segment after the split point.

Return the minimum bounding rectangle

Returns the vector between this segment's from and to points.

Returns the line containing this segment.

Computes the length of this segment.

Changes the segment's length, moving destination point.

Applies the transform to this segment and returns the results.

Computes the intersection (if any) between this segment and another one.

The result is provided in the form of the t parameter of each segment. To get the intersection point, sample one of the segments at the corresponding value.

Trait Implementations

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

impl<S> PartialEq<LineSegment<S>> for LineSegment<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 LineSegment<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).

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

Split this curve into two sub-curves.

Return the curve before the split point.

Return the curve after the split point.

Swap the direction of the segment.

Compute the length of the segment using a flattened approximation.

impl<S> Clone for LineSegment<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> FlatteningStep for LineSegment<S> where
    S: Scalar, 

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

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

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

Formats the value using the given formatter. Read more

Auto Trait Implementations

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

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