[−][src]Struct lyon_geom::LineSegment
A linear segment.
Fields
from: Point<S>
to: Point<S>
Methods
impl<S: Scalar> LineSegment<S>
[src]
pub fn sample(&self, t: S) -> Point<S>
[src]
Sample the segment at t (expecting t between 0 and 1).
pub fn x(&self, t: S) -> S
[src]
Sample the x coordinate of the segment at t (expecting t between 0 and 1).
pub fn y(&self, t: S) -> S
[src]
Sample the y coordinate of the segment at t (expecting t between 0 and 1).
pub fn from(&self) -> Point<S>
[src]
pub fn to(&self) -> Point<S>
[src]
pub fn solve_t_for_x(&self, x: S) -> S
[src]
pub fn solve_t_for_y(&self, y: S) -> S
[src]
pub fn solve_y_for_x(&self, x: S) -> S
[src]
pub fn solve_x_for_y(&self, y: S) -> S
[src]
pub fn flip(&self) -> Self
[src]
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]
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]
Split this curve into two sub-segments.
pub fn before_split(&self, t: S) -> Self
[src]
Return the segment before the split point.
pub fn after_split(&self, t: S) -> Self
[src]
Return the segment after the split point.
pub fn split_at_x(&self, x: S) -> (Self, Self)
[src]
pub fn bounding_rect(&self) -> Rect<S>
[src]
Return the minimum bounding rectangle
pub fn to_vector(&self) -> Vector<S>
[src]
Returns the vector between this segment's from
and to
points.
pub fn to_line(&self) -> Line<S>
[src]
Returns the line containing this segment.
pub fn length(&self) -> S
[src]
Computes the length of this segment.
pub fn set_length(&mut self, new_length: S)
[src]
Changes the segment's length, moving destination point.
pub fn translate(&mut self, by: Vector<S>) -> Self
[src]
pub fn transform(&self, transform: &Transform2D<S>) -> Self
[src]
Applies the transform to this segment and returns the results.
pub fn intersection_t(&self, other: &Self) -> Option<(S, S)>
[src]
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 line_intersection_t(&self, line: &Line<S>) -> Option<S>
[src]
pub fn line_intersection(&self, line: &Line<S>) -> Option<Point<S>>
[src]
pub fn horizontal_line_intersection_t(&self, y: S) -> Option<S>
[src]
pub fn vertical_line_intersection_t(&self, x: S) -> Option<S>
[src]
pub fn horizontal_line_intersection(&self, y: S) -> Option<Point<S>>
[src]
pub fn vertical_line_intersection(&self, x: S) -> Option<Point<S>>
[src]
pub fn intersects(&self, other: &Self) -> bool
[src]
pub fn intersects_line(&self, line: &Line<S>) -> bool
[src]
pub fn overlaps_line(&self, line: &Line<S>) -> bool
[src]
pub fn overlaps_segment(&self, other: &LineSegment<S>) -> bool
[src]
pub fn contains_segment(&self, other: &LineSegment<S>) -> bool
[src]
Trait Implementations
impl<S: Scalar> Segment for LineSegment<S>
[src]
type Scalar = S
fn from(&self) -> Point<S>
[src]
fn to(&self) -> Point<S>
[src]
fn sample(&self, t: S) -> Point<S>
[src]
fn x(&self, t: S) -> S
[src]
fn y(&self, t: S) -> S
[src]
fn derivative(&self, _t: S) -> Vector<S>
[src]
fn dx(&self, _t: S) -> S
[src]
fn dy(&self, _t: S) -> S
[src]
fn split_range(&self, t_range: Range<S>) -> Self
[src]
fn split(&self, t: S) -> (Self, Self)
[src]
fn before_split(&self, t: S) -> Self
[src]
fn after_split(&self, t: S) -> Self
[src]
fn flip(&self) -> Self
[src]
fn approximate_length(&self, _tolerance: S) -> S
[src]
impl<S: Scalar> FlatteningStep for LineSegment<S>
[src]
fn flattening_step(&self, _tolerance: S) -> S
[src]
fn flattened(self, tolerance: Self::Scalar) -> Flattened<Self::Scalar, Self>
[src]
Returns the flattened representation of the curve as an iterator, starting after the current point. Read more
impl<S: Copy> Copy for LineSegment<S>
[src]
impl<S: Clone> Clone for LineSegment<S>
[src]
fn clone(&self) -> LineSegment<S>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<S: PartialEq> PartialEq<LineSegment<S>> for LineSegment<S>
[src]
fn eq(&self, other: &LineSegment<S>) -> bool
[src]
fn ne(&self, other: &LineSegment<S>) -> bool
[src]
impl<S> From<LineSegment<S>> for BezierSegment<S>
[src]
fn from(s: LineSegment<S>) -> Self
[src]
impl<S: Debug> Debug for LineSegment<S>
[src]
Auto Trait Implementations
impl<S> Unpin for LineSegment<S> where
S: Unpin,
S: Unpin,
impl<S> Sync for LineSegment<S> where
S: Sync,
S: Sync,
impl<S> Send for LineSegment<S> where
S: Send,
S: Send,
impl<S> UnwindSafe for LineSegment<S> where
S: UnwindSafe,
S: UnwindSafe,
impl<S> RefUnwindSafe for LineSegment<S> where
S: RefUnwindSafe,
S: RefUnwindSafe,
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,