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

pub struct Cuboid<S = DefaultScalar> {
    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]

[src]

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

[src]

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

[src]

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

[src]

The position in the middle of the x range.

[src]

The position in the middle of the y range.

[src]

The position in the middle of the z range.

[src]

The xyz position in the middle of the bounds.

[src]

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

[src]

Shift the cuboid along the x axis.

[src]

Shift the cuboid along the y axis.

[src]

Shift the cuboid along the z axis.

[src]

Shift the cuboid by the given vector.

[src]

Does the given cuboid contain the given point.

[src]

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

[src]

The cuboid representing the area in which two cuboids overlap.

[src]

The cuboid that encompass the two given cuboids.

[src]

The start of the range along the x axis.

[src]

The end of the range along the x axis.

[src]

The start of the range along the y axis.

[src]

The end of the range along the y axis.

[src]

The start of the range along the z axis.

[src]

The end of the range along the z axis.

[src]

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

[src]

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

[src]

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

[src]

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

[src]

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

[src]

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

[src]

The quad for the given face.

[src]

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>
[src]

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

[src]

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

Important traits for FaceQuads<'a, S>
[src]

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

Important traits for Triangles<'a, S>
[src]

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

Uses the faces_iter method internally.

[src]

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

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

[src]

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

[src]

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

[src]

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

[src]

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

[src]

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

[src]

The total volume of the cuboid.

[src]

The position and dimensions of the cuboid.

[src]

The position and dimensions of the cuboid.

[src]

The cuboid with some padding applied to the left side.

[src]

The cuboid with some padding applied to the right side.

[src]

The cuboid with some padding applied to the bottom side.

[src]

The cuboid with some padding applied to the top side.

[src]

The cuboid with some padding applied to the front side.

[src]

The cuboid with some padding applied to the back side.

[src]

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]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

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

[src]

Formats the value using the given formatter. Read more

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

[src]

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

[src]

This method tests for !=.

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

[src]

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

[src]

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

[src]

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

[src]

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

[src]

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