Struct lyon_bezier::LineSegment
[−]
[src]
pub struct LineSegment { pub from: Point, pub to: Point, }
Fields
from: Point
to: Point
Methods
impl LineSegment
[src]
fn sample(&self, t: f32) -> Point
[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) -> Self
[src]
Returns an inverted version of this segment where the beginning and the end points are swapped.
fn split(&self, t: f32) -> (Self, Self)
[src]
Split this curve into two sub-segments.
fn before_split(&self, t: f32) -> Self
[src]
Return the segment before the split point.
fn after_split(&self, t: f32) -> Self
[src]
Return the segment after the split point.
fn bounding_rect(&self) -> Rect
[src]
Return the minimum bounding rectangle
fn to_vector(&self) -> Vec2
[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: Vec2) -> Self
[src]
fn transform(&self, transform: &Transform2D) -> Self
[src]
Applies the transform to this segment and returns the results.
fn intersection(&self, other: &Self) -> Option<Point>
[src]
Computes the intersection (if any) between this segment and another one.
fn intersects(&self, other: &Self) -> bool
[src]
Trait Implementations
impl Copy for LineSegment
[src]
impl Clone for LineSegment
[src]
fn clone(&self) -> LineSegment
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for LineSegment
[src]
impl PartialEq for LineSegment
[src]
fn eq(&self, __arg_0: &LineSegment) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &LineSegment) -> bool
[src]
This method tests for !=
.