Struct lyon::bezier::LineSegment
[−]
[src]
pub struct LineSegment { pub from: TypedPoint2D<f32, UnknownUnit>, pub to: TypedPoint2D<f32, UnknownUnit>, }
Fields
from: TypedPoint2D<f32, UnknownUnit>
to: TypedPoint2D<f32, UnknownUnit>
Methods
impl LineSegment
[src]
fn sample(&self, t: f32) -> TypedPoint2D<f32, UnknownUnit>
[src]
Sample the segment at t (expecting t between 0 and 1).
fn sample_x(&self, t: f32) -> f32
[src]
Sample the x coordinate of the segment at t (expecting t between 0 and 1).
fn sample_y(&self, t: f32) -> f32
[src]
Sample the y coordinate of the segment at t (expecting t between 0 and 1).
fn flip(&self) -> LineSegment
[src]
Returns an inverted version of this segment where the beginning and the end points are swapped.
fn split(&self, t: f32) -> (LineSegment, LineSegment)
[src]
Split this curve into two sub-segments.
fn before_split(&self, t: f32) -> LineSegment
[src]
Return the segment before the split point.
fn after_split(&self, t: f32) -> LineSegment
[src]
Return the segment after the split point.
fn bounding_rect(&self) -> TypedRect<f32, UnknownUnit>
[src]
Return the minimum bounding rectangle
fn to_vector(&self) -> TypedVector2D<f32, UnknownUnit>
[src]
Returns the vector between this segment's from
and to
points.
fn to_line(&self) -> Line
[src]
Returns the line containing this segment.
fn length(&self) -> f32
[src]
Computes the length of this segment.
fn translate(&mut self, by: TypedVector2D<f32, UnknownUnit>) -> LineSegment
[src]
fn transform(
&self,
transform: &TypedTransform2D<f32, UnknownUnit, UnknownUnit>
) -> LineSegment
[src]
&self,
transform: &TypedTransform2D<f32, UnknownUnit, UnknownUnit>
) -> LineSegment
Applies the transform to this segment and returns the results.
fn intersection(
&self,
other: &LineSegment
) -> Option<TypedPoint2D<f32, UnknownUnit>>
[src]
&self,
other: &LineSegment
) -> Option<TypedPoint2D<f32, UnknownUnit>>
Computes the intersection (if any) between this segment and another one.