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

pub struct Cuboid<S = f32> {
    pub x: Range<S>,
    pub y: Range<S>,
    pub z: Range<S>,
}
Expand description

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

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

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 centered x, y and z coordinates as a tuple.

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

The position and dimensions of the cuboid.

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.

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:

y
| z
|/
0---x

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

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.

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

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

Uses the faces_iter method internally.

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 tuple.

The total volume 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.

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

The xyz position in the middle of the bounds.

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

The position and dimensions of the cuboid.

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.

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

The xyz position in the middle of the bounds.

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

The position and dimensions of the cuboid.

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.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

This method tests for !=.

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

Blanket Implementations

Convert the source color to the destination color using the specified method Read more

Convert the source color to the destination color using the bradford method by default Read more

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Convert into T with values clamped to the color defined bounds Read more

Convert into T. The resulting color might be invalid in its color space Read more

Convert into T, returning ok if the color is inside of its defined range, otherwise an OutOfBounds error is returned which contains the unclamped color. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.