1
2
3
4
5
6
7
8
9
10
11
12
//! Intersections of geometric objects.

/// Trait for calculating the intersection with another geometric object.
pub trait Intersect<T: ?Sized> {
    /// The type of the output shape representing the intersection.
    type Output;
    /// Calculates the intersection of this shape with `other`.
    ///
    /// If no part of this shape lies within `other`,
    /// returns [`None`].
    fn intersect(&self, other: &T) -> Option<Self::Output>;
}