Skip to main content

Intersections

Enum Intersections 

Source
pub enum Intersections<T> {
    Found(Vec<T>),
    Coincident(Vec<T>),
}
Expand description

Result of a subdivision-based intersection search: either the complete, finite set of distinct solutions (fewer than the caller’s requested max_solutions), or a signal that the two shapes coincide/overlap over a shared region rather than meeting at finitely many isolated points.

Reaching exactly max_solutions (> 0) is the established signal for coincidence throughout this module — see curve_curve::curve_curve_intersect’s own doc comment for why the search’s breadth-first-by-level queue ordering specifically makes that reliable (an evenly-spread set of leaves across the whole shared region, not just a lucky cluster of adjacent ones). This enum makes that convention explicit and type-checked, in place of a result.len() >= max_solutions comparison every caller previously had to remember to make.

Intersections::Coincident still carries the (capped, evenly-spread) solutions found before the cap was hit — some callers detect coincidence some other way and just want every point regardless (see geop-ops-booleans::remesh::remesh_edges_x_edges); others want to reuse them for a follow-up geometric test instead of re-deriving them (see remesh_edges_x_faces::find_coincident_pair). Use Intersections::into_vec to get the solutions either way, or match to tell the two cases apart.

Variants§

§

Found(Vec<T>)

The complete set of distinct solutions — strictly fewer than the requested max_solutions (or max_solutions was 0).

§

Coincident(Vec<T>)

max_solutions (> 0) distinct solutions were found before the search exhausted the domain: read as coincidence (or, for a partial overlap, an extended shared region), not a finite crossing count.

Implementations§

Source§

impl<T> Intersections<T>

Source

pub fn is_coincident(&self) -> bool

Source

pub fn into_vec(self) -> Vec<T>

The solutions found, regardless of variant.

Source

pub fn as_slice(&self) -> &[T]

The solutions found, regardless of variant.

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Trait Implementations§

Source§

impl<T: Clone> Clone for Intersections<T>

Source§

fn clone(&self) -> Intersections<T>

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<T: Debug> Debug for Intersections<T>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> Freeze for Intersections<T>

§

impl<T> RefUnwindSafe for Intersections<T>
where T: RefUnwindSafe,

§

impl<T> Send for Intersections<T>
where T: Send,

§

impl<T> Sync for Intersections<T>
where T: Sync,

§

impl<T> Unpin for Intersections<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for Intersections<T>

§

impl<T> UnwindSafe for Intersections<T>
where T: 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> 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.