Struct implicit3d::BoundingBox
[−]
[src]
pub struct BoundingBox<S> where
S: Debug + Real, { pub min: Point<S, U3>, pub max: Point<S, U3>, }
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.
Methods
impl<S> BoundingBox<S> where
S: Real + Float,
[src]
S: Real + Float,
pub fn infinity() -> BoundingBox<S>
[src]
Returns an infinte sized box.
pub fn neg_infinity() -> BoundingBox<S>
[src]
Returns a negatively infinte sized box.
pub fn new(a: &Point<S, U3>, b: &Point<S, U3>) -> BoundingBox<S>
[src]
Create a new Bounding Box by supplying two points.
pub fn union(&self, other: &BoundingBox<S>) -> BoundingBox<S>
[src]
Create a CSG Union of two Bounding Boxes.
pub fn intersection(&self, other: &BoundingBox<S>) -> BoundingBox<S>
[src]
Create a CSG Intersection of two Bounding Boxes.
pub fn transform<M>(&self, mat: &M) -> BoundingBox<S> where
M: Transformation<Point<S, U3>>,
[src]
M: Transformation<Point<S, U3>>,
Transform a Bounding Box - resulting in a enclosing axis aligned Bounding Box.
pub fn dilate(&mut self, d: S) -> &mut BoundingBox<S>
[src]
Dilate a Bounding Box by some amount in all directions.
pub fn insert(&mut self, o: &Point<S, U3>) -> &mut BoundingBox<S>
[src]
Add a Point to a Bounding Box, e.g. expand the Bounding Box to contain that point.
pub fn dim(
&self
) -> Matrix<S, U3, U1, <DefaultAllocator as Allocator<S, U3, U1>>::Buffer>
[src]
&self
) -> Matrix<S, U3, U1, <DefaultAllocator as Allocator<S, U3, U1>>::Buffer>
Return the size of the Box.
pub fn distance(&self, p: &Point<S, U3>) -> S
[src]
Returns the approximate distance of p to the box. The result is guarateed to be not less than the euclidean distance of p to the box.
pub fn contains(&self, p: &Point<S, U3>) -> bool
[src]
Return true if the Bounding Box contains p.
Trait Implementations
impl<S> PartialEq<BoundingBox<S>> for BoundingBox<S> where
S: PartialEq<S> + Debug + Real,
[src]
S: PartialEq<S> + Debug + Real,
fn eq(&self, __arg_0: &BoundingBox<S>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &BoundingBox<S>) -> bool
[src]
This method tests for !=
.
impl<S> Clone for BoundingBox<S> where
S: Clone + Debug + Real,
[src]
S: Clone + Debug + Real,
fn clone(&self) -> BoundingBox<S>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<S> Debug for BoundingBox<S> where
S: Debug + Debug + Real,
[src]
S: Debug + Debug + Real,