Skip to main content

SegmentIntersection

Enum SegmentIntersection 

Source
pub enum SegmentIntersection<P> {
    Disjoint,
    Single(P),
    Collinear {
        from: P,
        to: P,
    },
    OutOfRange,
}
Expand description

The outcome of intersecting two segments.

Mirrors the three shapes Boost’s strategy::intersection::cartesian_segments can produce: no intersection, exactly one point, or a collinear overlap delimited by two points (intersection.hpp, the segment_intersection_points count of 0 / 1 / 2). A fourth variant records the robustness-gate rejection that the “no rescale” policy requires .

Variants§

§

Disjoint

The segments do not meet.

§

Single(P)

The segments meet at exactly one point.

§

Collinear

The segments are collinear and overlap along the closed stretch from from to to (a single shared endpoint collapses to from == to, but that case is reported as Self::Single).

Fields

§from: P

One end of the shared collinear stretch.

§to: P

The other end of the shared collinear stretch.

§

OutOfRange

An endpoint fell outside the safe arithmetic range; per the no-rescale policy the intersection is refused rather than computed with an untrustworthy sign.

Trait Implementations§

Source§

impl<P: Clone> Clone for SegmentIntersection<P>

Source§

fn clone(&self) -> SegmentIntersection<P>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<P: Copy> Copy for SegmentIntersection<P>

Source§

impl<P: Debug> Debug for SegmentIntersection<P>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<P: PartialEq> PartialEq for SegmentIntersection<P>

Source§

fn eq(&self, other: &SegmentIntersection<P>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<P: PartialEq> StructuralPartialEq for SegmentIntersection<P>

Auto Trait Implementations§

§

impl<P> Freeze for SegmentIntersection<P>
where P: Freeze,

§

impl<P> RefUnwindSafe for SegmentIntersection<P>
where P: RefUnwindSafe,

§

impl<P> Send for SegmentIntersection<P>
where P: Send,

§

impl<P> Sync for SegmentIntersection<P>
where P: Sync,

§

impl<P> Unpin for SegmentIntersection<P>
where P: Unpin,

§

impl<P> UnsafeUnpin for SegmentIntersection<P>
where P: UnsafeUnpin,

§

impl<P> UnwindSafe for SegmentIntersection<P>
where P: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> SameAs<T> for T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.