Struct lyon_geom::LineSegment [−][src]
A linear segment.
Fields
from: Point<S>
to: Point<S>
Methods
impl<S: Scalar> LineSegment<S>
[src]
impl<S: Scalar> LineSegment<S>
pub fn sample(&self, t: S) -> Point<S>
[src]
pub fn sample(&self, t: S) -> Point<S>
Sample the segment at t (expecting t between 0 and 1).
pub fn x(&self, t: S) -> S
[src]
pub fn x(&self, t: S) -> S
Sample the x coordinate of the segment at t (expecting t between 0 and 1).
pub fn y(&self, t: S) -> S
[src]
pub fn y(&self, t: S) -> S
Sample the y coordinate of the segment at t (expecting t between 0 and 1).
pub fn from(&self) -> Point<S>
[src]
pub fn from(&self) -> Point<S>
pub fn to(&self) -> Point<S>
[src]
pub fn to(&self) -> Point<S>
pub fn solve_t_for_x(&self, x: S) -> S
[src]
pub fn solve_t_for_x(&self, x: S) -> S
pub fn solve_t_for_y(&self, y: S) -> S
[src]
pub fn solve_t_for_y(&self, y: S) -> S
pub fn solve_y_for_x(&self, x: S) -> S
[src]
pub fn solve_y_for_x(&self, x: S) -> S
pub fn solve_x_for_y(&self, y: S) -> S
[src]
pub fn solve_x_for_y(&self, y: S) -> S
pub fn flip(&self) -> Self
[src]
pub fn flip(&self) -> Self
Returns an inverted version of this segment where the beginning and the end points are swapped.
pub fn split_range(&self, t_range: Range<S>) -> Self
[src]
pub fn split_range(&self, t_range: Range<S>) -> Self
Return the sub-segment inside a given range of t.
This is equivalent splitting at the range's end points.
pub fn split(&self, t: S) -> (Self, Self)
[src]
pub fn split(&self, t: S) -> (Self, Self)
Split this curve into two sub-segments.
pub fn before_split(&self, t: S) -> Self
[src]
pub fn before_split(&self, t: S) -> Self
Return the segment before the split point.
pub fn after_split(&self, t: S) -> Self
[src]
pub fn after_split(&self, t: S) -> Self
Return the segment after the split point.
pub fn split_at_x(&self, x: S) -> (Self, Self)
[src]
pub fn split_at_x(&self, x: S) -> (Self, Self)
pub fn bounding_rect(&self) -> Rect<S>
[src]
pub fn bounding_rect(&self) -> Rect<S>
Return the minimum bounding rectangle
pub fn to_vector(&self) -> Vector<S>
[src]
pub fn to_vector(&self) -> Vector<S>
Returns the vector between this segment's from
and to
points.
pub fn to_line(&self) -> Line<S>
[src]
pub fn to_line(&self) -> Line<S>
Returns the line containing this segment.
pub fn length(&self) -> S
[src]
pub fn length(&self) -> S
Computes the length of this segment.
pub fn set_length(&mut self, new_length: S)
[src]
pub fn set_length(&mut self, new_length: S)
Changes the segment's length, moving destination point.
pub fn translate(&mut self, by: Vector<S>) -> Self
[src]
pub fn translate(&mut self, by: Vector<S>) -> Self
pub fn transform(&self, transform: &Transform2D<S>) -> Self
[src]
pub fn transform(&self, transform: &Transform2D<S>) -> Self
Applies the transform to this segment and returns the results.
pub fn intersection_t(&self, other: &Self) -> Option<(S, S)>
[src]
pub fn intersection_t(&self, other: &Self) -> Option<(S, S)>
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.
pub fn intersection(&self, other: &Self) -> Option<Point<S>>
[src]
pub fn intersection(&self, other: &Self) -> Option<Point<S>>
pub fn intersects(&self, other: &Self) -> bool
[src]
pub fn intersects(&self, other: &Self) -> bool
Trait Implementations
impl<S: Copy> Copy for LineSegment<S>
[src]
impl<S: Copy> Copy for LineSegment<S>
impl<S: Clone> Clone for LineSegment<S>
[src]
impl<S: Clone> Clone for LineSegment<S>
fn clone(&self) -> LineSegment<S>
[src]
fn clone(&self) -> LineSegment<S>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<S: Debug> Debug for LineSegment<S>
[src]
impl<S: Debug> Debug for LineSegment<S>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<S: PartialEq> PartialEq for LineSegment<S>
[src]
impl<S: PartialEq> PartialEq for LineSegment<S>
fn eq(&self, other: &LineSegment<S>) -> bool
[src]
fn eq(&self, other: &LineSegment<S>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &LineSegment<S>) -> bool
[src]
fn ne(&self, other: &LineSegment<S>) -> bool
This method tests for !=
.
impl<S: Scalar> Segment for LineSegment<S>
[src]
impl<S: Scalar> Segment for LineSegment<S>
type Scalar = S
fn from(&self) -> Point<S>
[src]
fn from(&self) -> Point<S>
Start of the curve.
fn to(&self) -> Point<S>
[src]
fn to(&self) -> Point<S>
End of the curve.
fn sample(&self, t: S) -> Point<S>
[src]
fn sample(&self, t: S) -> Point<S>
Sample the curve at t (expecting t between 0 and 1).
fn x(&self, t: S) -> S
[src]
fn x(&self, t: S) -> S
Sample x at t (expecting t between 0 and 1).
fn y(&self, t: S) -> S
[src]
fn y(&self, t: S) -> S
Sample y at t (expecting t between 0 and 1).
fn derivative(&self, _t: S) -> Vector<S>
[src]
fn derivative(&self, _t: S) -> Vector<S>
Sample the derivative at t (expecting t between 0 and 1).
fn dx(&self, _t: S) -> S
[src]
fn dx(&self, _t: S) -> S
Sample x derivative at t (expecting t between 0 and 1).
fn dy(&self, _t: S) -> S
[src]
fn dy(&self, _t: S) -> S
Sample y derivative at t (expecting t between 0 and 1).
fn split_range(&self, t_range: Range<S>) -> Self
[src]
fn split_range(&self, t_range: Range<S>) -> Self
Return the curve inside a given range of t. Read more
fn split(&self, t: S) -> (Self, Self)
[src]
fn split(&self, t: S) -> (Self, Self)
Split this curve into two sub-curves.
fn before_split(&self, t: S) -> Self
[src]
fn before_split(&self, t: S) -> Self
Return the curve before the split point.
fn after_split(&self, t: S) -> Self
[src]
fn after_split(&self, t: S) -> Self
Return the curve after the split point.
fn flip(&self) -> Self
[src]
fn flip(&self) -> Self
Swap the direction of the segment.
fn approximate_length(&self, _tolerance: S) -> S
[src]
fn approximate_length(&self, _tolerance: S) -> S
Compute the length of the segment using a flattened approximation.
impl<S: Scalar> FlatteningStep for LineSegment<S>
[src]
impl<S: Scalar> FlatteningStep for LineSegment<S>
fn flattening_step(&self, _tolerance: S) -> S
[src]
fn flattening_step(&self, _tolerance: S) -> S
Find the interval of the begining of the curve that can be approximated with a line segment. Read more
fn flattened(self, tolerance: Self::Scalar) -> Flattened<Self::Scalar, Self>
[src]
fn flattened(self, tolerance: Self::Scalar) -> Flattened<Self::Scalar, Self>
Returns the flattened representation of the curve as an iterator, starting after the current point. Read more
Auto Trait Implementations
impl<S> Send for LineSegment<S> where
S: Send,
impl<S> Send for LineSegment<S> where
S: Send,
impl<S> Sync for LineSegment<S> where
S: Sync,
impl<S> Sync for LineSegment<S> where
S: Sync,