Struct nannou::geom::cuboid::Cuboid[][src]

pub struct Cuboid<S = Default> {
    pub x: Range<S>,
    pub y: Range<S>,
    pub z: Range<S>,
}

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

The start and end along the x axis.

The start and end along the y axis.

The start and end along the z axis.

Methods

impl<S> Cuboid<S> where
    S: BaseNum
[src]

Construct a Rect from a given centre point (x, y, z) and dimensions (width, height, depth).

Construct a cuboid from its x, y and z ranges.

Converts self to an absolute Cuboid so that the magnitude of each range is always positive.

The position in the middle of the x range.

The position in the middle of the y range.

The position in the middle of the z range.

The xyz position in the middle of the bounds.

The centered x, y and z coordinates as a tuple.

Shift the cuboid along the x axis.

Shift the cuboid along the y axis.

Shift the cuboid along the z axis.

Shift the cuboid by the given vector.

Does the given cuboid contain the given point.

Stretches the closest side(s) to the given point if the point lies outside of the Cuboid area.

The cuboid representing the area in which two cuboids overlap.

The cuboid that encompass the two given cuboids.

The start of the range along the x axis.

The end of the range along the x axis.

The start of the range along the y axis.

The end of the range along the y axis.

The start of the range along the z axis.

The end of the range along the z axis.

The quad for the face at the start of the range along the x axis.

The quad for the face at the end of the range along the x axis.

The quad for the face at the start of the range along the y axis.

The quad for the face at the end of the range along the y axis.

The quad for the face at the start of the range along the z axis.

The quad for the face at the end of the range along the z axis.

The quad for the given face.

The 8 corners of the cuboid in the following order:

This example is not tested
y
| z
|/
0---x

  6---7
 /|  /|
2---3 |
| 4-|-5
|/  |/
0---1

Important traits for Corners<'a, S>

The same as corners but produces an iterator rather than a fixed-size array.

The 6 faces of the of the cuboid in the order yielded by the Faces iterator.

Important traits for FaceQuads<'a, S>

An iterator yielding a quad for each face on the cuboid.

Important traits for Triangles<'a, S>

Produce an iterator yielding every triangle in the cuboid (two for each face).

Uses the faces_iter method internally.

The six ranges used for the Cuboid's eight subdivisions.

impl<S> Cuboid<S> where
    S: BaseNum + Neg<Output = S>, 
[src]

The length of the cuboid along the x axis (aka width or w for short).

The length of the cuboid along the y axis (aka height or h for short).

The length of the cuboid along the z axis (aka depth or d for short).

The dimensions (width, height and depth) of the cuboid as a vector.

The dimensions (width, height and depth) of the cuboid as a tuple.

The total volume of the cuboid.

The position and dimensions of the cuboid.

The position and dimensions of the cuboid.

The cuboid with some padding applied to the left side.

The cuboid with some padding applied to the right side.

The cuboid with some padding applied to the bottom side.

The cuboid with some padding applied to the top side.

The cuboid with some padding applied to the front side.

The cuboid with some padding applied to the back side.

The cuboid with some padding amount applied to each side.

Trait Implementations

impl<S: Copy> Copy for Cuboid<S>
[src]

impl<S: Clone> Clone for Cuboid<S>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<S: Debug> Debug for Cuboid<S>
[src]

Formats the value using the given formatter. Read more

impl<S: PartialEq> PartialEq for Cuboid<S>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<S: PartialOrd> PartialOrd for Cuboid<S>
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations

impl<S> Send for Cuboid<S> where
    S: Send

impl<S> Sync for Cuboid<S> where
    S: Sync