Struct implicit3d::BoundingBox
source · pub struct BoundingBox<S>where
S: RealField + Debug,{
pub min: Point<S, U3>,
pub max: Point<S, U3>,
}
Expand description
3D Bounding Box - defined by two diagonally opposing points.
Fields§
§min: Point<S, U3>
X-Y-Z-Minimum corner of the box.
max: Point<S, U3>
X-Y-Z-Maximum corner of the box.
Implementations§
source§impl<S> BoundingBox<S>where
S: Float + RealField,
impl<S> BoundingBox<S>where
S: Float + RealField,
sourcepub fn infinity() -> BoundingBox<S>
pub fn infinity() -> BoundingBox<S>
Returns an infinte sized box.
sourcepub fn neg_infinity() -> BoundingBox<S>
pub fn neg_infinity() -> BoundingBox<S>
Returns a negatively infinte sized box.
sourcepub fn new(a: &Point<S, U3>, b: &Point<S, U3>) -> BoundingBox<S>
pub fn new(a: &Point<S, U3>, b: &Point<S, U3>) -> BoundingBox<S>
Create a new Bounding Box by supplying two points.
sourcepub fn union(&self, other: &BoundingBox<S>) -> BoundingBox<S>
pub fn union(&self, other: &BoundingBox<S>) -> BoundingBox<S>
Create a CSG Union of two Bounding Boxes.
sourcepub fn intersection(&self, other: &BoundingBox<S>) -> BoundingBox<S>
pub fn intersection(&self, other: &BoundingBox<S>) -> BoundingBox<S>
Create a CSG Intersection of two Bounding Boxes.
sourcepub fn transform<M>(&self, mat: &M) -> BoundingBox<S>where
M: Transformation<Point<S, U3>>,
pub fn transform<M>(&self, mat: &M) -> BoundingBox<S>where
M: Transformation<Point<S, U3>>,
Transform a Bounding Box - resulting in a enclosing axis aligned Bounding Box.
sourcepub fn dilate(&mut self, d: S) -> &mut BoundingBox<S>
pub fn dilate(&mut self, d: S) -> &mut BoundingBox<S>
Dilate a Bounding Box by some amount in all directions.
sourcepub fn insert(&mut self, o: &Point<S, U3>) -> &mut BoundingBox<S>
pub fn insert(&mut self, o: &Point<S, U3>) -> &mut BoundingBox<S>
Add a Point to a Bounding Box, e.g. expand the Bounding Box to contain that point.
sourcepub fn dim(
&self
) -> Matrix<S, U3, U1, <DefaultAllocator as Allocator<S, U3, U1>>::Buffer>
pub fn dim(
&self
) -> Matrix<S, U3, U1, <DefaultAllocator as Allocator<S, U3, U1>>::Buffer>
Return the size of the Box.
Trait Implementations§
source§impl<T> AbsDiffEq<BoundingBox<T>> for BoundingBox<T>where
T: Float + RealField + AbsDiffEq<T>,
<T as AbsDiffEq<T>>::Epsilon: Copy,
impl<T> AbsDiffEq<BoundingBox<T>> for BoundingBox<T>where
T: Float + RealField + AbsDiffEq<T>,
<T as AbsDiffEq<T>>::Epsilon: Copy,
source§fn default_epsilon() -> <BoundingBox<T> as AbsDiffEq<BoundingBox<T>>>::Epsilon
fn default_epsilon() -> <BoundingBox<T> as AbsDiffEq<BoundingBox<T>>>::Epsilon
The default tolerance to use when testing values that are close together. Read more
source§fn abs_diff_eq(
&self,
other: &BoundingBox<T>,
epsilon: <BoundingBox<T> as AbsDiffEq<BoundingBox<T>>>::Epsilon
) -> bool
fn abs_diff_eq(
&self,
other: &BoundingBox<T>,
epsilon: <BoundingBox<T> as AbsDiffEq<BoundingBox<T>>>::Epsilon
) -> bool
A test for equality that uses the absolute difference to compute the approximate
equality of two numbers. Read more
§fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
The inverse of
ApproxEq::abs_diff_eq
.source§impl<S> Clone for BoundingBox<S>where
S: Clone + RealField + Debug,
impl<S> Clone for BoundingBox<S>where
S: Clone + RealField + Debug,
source§fn clone(&self) -> BoundingBox<S>
fn clone(&self) -> BoundingBox<S>
Returns a copy 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 moresource§impl<S> PartialEq<BoundingBox<S>> for BoundingBox<S>where
S: PartialEq<S> + RealField + Debug,
impl<S> PartialEq<BoundingBox<S>> for BoundingBox<S>where
S: PartialEq<S> + RealField + Debug,
source§fn eq(&self, other: &BoundingBox<S>) -> bool
fn eq(&self, other: &BoundingBox<S>) -> bool
source§impl<T> RelativeEq<BoundingBox<T>> for BoundingBox<T>where
T: Float + RealField + RelativeEq<T>,
<T as AbsDiffEq<T>>::Epsilon: Copy,
impl<T> RelativeEq<BoundingBox<T>> for BoundingBox<T>where
T: Float + RealField + RelativeEq<T>,
<T as AbsDiffEq<T>>::Epsilon: Copy,
source§fn default_max_relative() -> <T as AbsDiffEq<T>>::Epsilon
fn default_max_relative() -> <T as AbsDiffEq<T>>::Epsilon
The default relative tolerance for testing values that are far-apart. Read more
source§fn relative_eq(
&self,
other: &BoundingBox<T>,
epsilon: <T as AbsDiffEq<T>>::Epsilon,
max_relative: <T as AbsDiffEq<T>>::Epsilon
) -> bool
fn relative_eq(
&self,
other: &BoundingBox<T>,
epsilon: <T as AbsDiffEq<T>>::Epsilon,
max_relative: <T as AbsDiffEq<T>>::Epsilon
) -> bool
A test for equality that uses a relative comparison if the values are far apart.
§fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
The inverse of
ApproxEq::relative_eq
.impl<S> StructuralPartialEq for BoundingBox<S>where
S: RealField + Debug,
Auto Trait Implementations§
impl<S> RefUnwindSafe for BoundingBox<S>where
S: RefUnwindSafe,
impl<S> Send for BoundingBox<S>
impl<S> Sync for BoundingBox<S>
impl<S> Unpin for BoundingBox<S>where
S: Unpin,
impl<S> UnwindSafe for BoundingBox<S>where
S: UnwindSafe,
Blanket Implementations§
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§unsafe fn to_subset_unchecked(&self) -> SS
unsafe 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.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§unsafe fn to_subset_unchecked(&self) -> SS
unsafe 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.