[−][src]Struct nannou::geom::cuboid::Cuboid
A light-weight Cuboid
type with many helper and utility methods.
The cuboid is also known as a "rectangular prism".
Cuboid
is implemented similarly to geom::Rect
but with 3 axes instead of 2.
Fields
x: Range<S>
The start and end along the x axis.
y: Range<S>
The start and end along the y axis.
z: Range<S>
The start and end along the z axis.
Implementations
impl<S> Cuboid<S> where
S: BaseNum,
[src]
S: BaseNum,
pub fn from_xyz_whd(p: Point3<S>, d: Vector3<S>) -> Self
[src]
Construct a Rect from a given centre point (x, y, z) and dimensions (width, height, depth).
pub fn from_ranges(x: Range<S>, y: Range<S>, z: Range<S>) -> Self
[src]
Construct a cuboid from its x, y and z ranges.
pub fn absolute(&self) -> Self
[src]
Converts self
to an absolute Cuboid
so that the magnitude of each range is always
positive.
pub fn x(&self) -> S
[src]
The position in the middle of the x range.
pub fn y(&self) -> S
[src]
The position in the middle of the y range.
pub fn z(&self) -> S
[src]
The position in the middle of the z range.
pub fn xyz(&self) -> Point3<S>
[src]
The xyz position in the middle of the bounds.
pub fn x_y_z(&self) -> (S, S, S)
[src]
The centered x, y and z coordinates as a tuple.
pub fn shift_x(self, x: S) -> Self
[src]
Shift the cuboid along the x axis.
pub fn shift_y(self, y: S) -> Self
[src]
Shift the cuboid along the y axis.
pub fn shift_z(self, z: S) -> Self
[src]
Shift the cuboid along the z axis.
pub fn shift(self, v: Vector3<S>) -> Self
[src]
Shift the cuboid by the given vector.
pub fn contains(&self, p: Point3<S>) -> bool
[src]
Does the given cuboid contain the given point.
pub fn stretch_to_point(self, p: Point3<S>) -> Self
[src]
Stretches the closest side(s) to the given point if the point lies outside of the Cuboid area.
pub fn overlap(self, other: Self) -> Option<Self>
[src]
The cuboid representing the area in which two cuboids overlap.
pub fn max(self, other: Self) -> Self where
S: Float,
[src]
S: Float,
The cuboid that encompass the two given cuboids.
pub fn left(&self) -> S
[src]
The start of the range along the x axis.
pub fn right(&self) -> S
[src]
The end of the range along the x axis.
pub fn bottom(&self) -> S
[src]
The start of the range along the y axis.
pub fn top(&self) -> S
[src]
The end of the range along the y axis.
pub fn front(&self) -> S
[src]
The start of the range along the z axis.
pub fn back(&self) -> S
[src]
The end of the range along the z axis.
pub fn left_quad(&self) -> FaceQuad<S>
[src]
The quad for the face at the start of the range along the x axis.
pub fn right_quad(&self) -> FaceQuad<S>
[src]
The quad for the face at the end of the range along the x axis.
pub fn bottom_quad(&self) -> FaceQuad<S>
[src]
The quad for the face at the start of the range along the y axis.
pub fn top_quad(&self) -> FaceQuad<S>
[src]
The quad for the face at the end of the range along the y axis.
pub fn front_quad(&self) -> FaceQuad<S>
[src]
The quad for the face at the start of the range along the z axis.
pub fn back_quad(&self) -> FaceQuad<S>
[src]
The quad for the face at the end of the range along the z axis.
pub fn face_quad(&self, face: Face) -> FaceQuad<S>
[src]
The quad for the given face.
pub fn corners(&self) -> [Point3<S>; 8]
[src]
The 8 corners of the cuboid in the following order:
y | z |/ 0---x 6---7 /| /| 2---3 | | 4-|-5 |/ |/ 0---1
pub fn corners_iter(&self) -> Corners<'_, S>ⓘ
[src]
The same as corners
but produces an iterator rather than a fixed-size array.
pub fn faces(&self) -> [FaceQuad<S>; 6]
[src]
The 6 faces of the of the cuboid in the order yielded by the Faces
iterator.
pub fn faces_iter(&self) -> FaceQuads<'_, S>ⓘ
[src]
An iterator yielding a quad for each face on the cuboid.
pub fn triangles_iter(&self) -> Triangles<'_, S>ⓘ
[src]
Produce an iterator yielding every triangle in the cuboid (two for each face).
Uses the faces_iter
method internally.
pub fn subdivision_ranges(&self) -> SubdivisionRanges<S>
[src]
The six ranges used for the Cuboid
's eight subdivisions.
impl<S> Cuboid<S> where
S: BaseNum + Neg<Output = S>,
[src]
S: BaseNum + Neg<Output = S>,
pub fn w(&self) -> S
[src]
The length of the cuboid along the x axis (aka width
or w
for short).
pub fn h(&self) -> S
[src]
The length of the cuboid along the y axis (aka height
or h
for short).
pub fn d(&self) -> S
[src]
The length of the cuboid along the z axis (aka depth
or d
for short).
pub fn whd(&self) -> Vector3<S>
[src]
The dimensions (width, height and depth) of the cuboid as a vector.
pub fn w_h_d(&self) -> (S, S, S)
[src]
The dimensions (width, height and depth) of the cuboid as a tuple.
pub fn volume(&self) -> S
[src]
The total volume of the cuboid.
pub fn xyz_whd(&self) -> (Point3<S>, Vector3<S>)
[src]
The position and dimensions of the cuboid.
pub fn x_y_z_w_h_d(&self) -> (S, S, S, S, S, S)
[src]
The position and dimensions of the cuboid.
pub fn pad_left(self, pad: S) -> Self
[src]
The cuboid with some padding applied to the left side.
pub fn pad_right(self, pad: S) -> Self
[src]
The cuboid with some padding applied to the right side.
pub fn pad_bottom(self, pad: S) -> Self
[src]
The cuboid with some padding applied to the bottom side.
pub fn pad_top(self, pad: S) -> Self
[src]
The cuboid with some padding applied to the top side.
pub fn pad_front(self, pad: S) -> Self
[src]
The cuboid with some padding applied to the front side.
pub fn pad_back(self, pad: S) -> Self
[src]
The cuboid with some padding applied to the back side.
pub fn pad(self, pad: S) -> Self
[src]
The cuboid with some padding amount applied to each side.
Trait Implementations
impl<S: Clone> Clone for Cuboid<S>
[src]
impl<S: Copy> Copy for Cuboid<S>
[src]
impl<S: Debug> Debug for Cuboid<S>
[src]
impl<S: PartialEq> PartialEq<Cuboid<S>> for Cuboid<S>
[src]
impl<S: PartialOrd> PartialOrd<Cuboid<S>> for Cuboid<S>
[src]
fn partial_cmp(&self, other: &Cuboid<S>) -> Option<Ordering>
[src]
fn lt(&self, other: &Cuboid<S>) -> bool
[src]
fn le(&self, other: &Cuboid<S>) -> bool
[src]
fn gt(&self, other: &Cuboid<S>) -> bool
[src]
fn ge(&self, other: &Cuboid<S>) -> bool
[src]
impl<S> StructuralPartialEq for Cuboid<S>
[src]
Auto Trait Implementations
impl<S> RefUnwindSafe for Cuboid<S> where
S: RefUnwindSafe,
S: RefUnwindSafe,
impl<S> Send for Cuboid<S> where
S: Send,
S: Send,
impl<S> Sync for Cuboid<S> where
S: Sync,
S: Sync,
impl<S> Unpin for Cuboid<S> where
S: Unpin,
S: Unpin,
impl<S> UnwindSafe for Cuboid<S> where
S: UnwindSafe,
S: UnwindSafe,
Blanket Implementations
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
D: AdaptFrom<S, Swp, Dwp, T>,
Dwp: WhitePoint,
Swp: WhitePoint,
T: Component + Float,
[src]
D: AdaptFrom<S, Swp, Dwp, T>,
Dwp: WhitePoint,
Swp: WhitePoint,
T: Component + Float,
fn adapt_into_using<M>(self, method: M) -> D where
M: TransformMatrix<Swp, Dwp, T>,
[src]
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into(self) -> D
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> ConvertInto<U> for T where
U: ConvertFrom<T>,
[src]
U: ConvertFrom<T>,
fn convert_into(self) -> U
[src]
fn convert_unclamped_into(self) -> U
[src]
fn try_convert_into(self) -> Result<U, OutOfBounds<U>>
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<T> Style for T where
T: Any + Debug + PartialEq<T>,
[src]
T: Any + Debug + PartialEq<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,