pub struct BoundingBox {
pub min: Array1<f64>,
pub max: Array1<f64>,
}Expand description
A 3D bounding box defined by its minimum and maximum corners
Fields§
§min: Array1<f64>Minimum coordinates of the box (lower left front corner)
max: Array1<f64>Maximum coordinates of the box (upper right back corner)
Implementations§
Source§impl BoundingBox
impl BoundingBox
Sourcepub fn new(
min: &ArrayView1<'_, f64>,
max: &ArrayView1<'_, f64>,
) -> SpatialResult<Self>
pub fn new( min: &ArrayView1<'_, f64>, max: &ArrayView1<'_, f64>, ) -> SpatialResult<Self>
Sourcepub fn from_points(points: &ArrayView2<'_, f64>) -> SpatialResult<Self>
pub fn from_points(points: &ArrayView2<'_, f64>) -> SpatialResult<Self>
Sourcepub fn contains(&self, point: &ArrayView1<'_, f64>) -> SpatialResult<bool>
pub fn contains(&self, point: &ArrayView1<'_, f64>) -> SpatialResult<bool>
Sourcepub fn dimensions(&self) -> Array1<f64>
pub fn dimensions(&self) -> Array1<f64>
Get the dimensions (width, height, depth) of the bounding box
§Returns
An array containing the dimensions of the box
Sourcepub fn overlaps(&self, other: &BoundingBox) -> bool
pub fn overlaps(&self, other: &BoundingBox) -> bool
Sourcepub fn squared_distance_to_point(
&self,
point: &ArrayView1<'_, f64>,
) -> SpatialResult<f64>
pub fn squared_distance_to_point( &self, point: &ArrayView1<'_, f64>, ) -> SpatialResult<f64>
Sourcepub fn split_into_octants(&self) -> [BoundingBox; 8]
pub fn split_into_octants(&self) -> [BoundingBox; 8]
Split the bounding box into 8 equal octants
§Returns
An array of 8 bounding boxes representing the octants
Trait Implementations§
Source§impl Clone for BoundingBox
impl Clone for BoundingBox
Source§fn clone(&self) -> BoundingBox
fn clone(&self) -> BoundingBox
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for BoundingBox
impl RefUnwindSafe for BoundingBox
impl Send for BoundingBox
impl Sync for BoundingBox
impl Unpin for BoundingBox
impl UnwindSafe for BoundingBox
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.