#[repr(C)]
pub struct Box3D<T, U> { pub min: Point3D<T, U>, pub max: Point3D<T, U>, }
Expand description

An axis aligned 3D box represented by its minimum and maximum coordinates.

Fields

min: Point3D<T, U>max: Point3D<T, U>

Implementations

Constructor.

Creates a Box3D of the given size, at offset zero.

Returns true if the box has a negative volume.

The common interpretation for a negative box is to consider it empty. It can be obtained by calculating the intersection of two boxes that do not intersect.

Returns true if the size is zero, negative or NaN.

Returns true if this box3d contains the point. Points are considered in the box3d if they are on the front, left or top faces, but outside if they are on the back, right or bottom faces.

Returns true if this box3d contains the interior of the other box3d. Always returns true if other is empty, and always returns false if other is nonempty but this box3d is empty.

Computes the union of two boxes.

If either of the boxes is empty, the other one is returned.

Returns the same box3d, translated by a vector.

Inflates the box by the specified sizes on each side respectively.

Returns the smallest box containing all of the provided points.

Linearly interpolate between this box3d and another box3d.

Constructor, setting all sides to zero.

Drop the units, preserving only the numeric value.

Tag a unitless value with units.

Cast the unit

Cast from one numeric representation to another, preserving the units.

When casting from floating point to integer coordinates, the decimals are truncated as one would expect from a simple cast, but this behavior does not always make sense geometrically. Consider using round(), round_in or round_out() before casting.

Fallible cast from one numeric representation to another, preserving the units.

When casting from floating point to integer coordinates, the decimals are truncated as one would expect from a simple cast, but this behavior does not always make sense geometrically. Consider using round(), round_in or round_out() before casting.

Cast into an f32 box3d.

Cast into an f64 box3d.

Cast into an usize box3d, truncating decimals if any.

When casting from floating point cuboids, it is worth considering whether to round(), round_in() or round_out() before the cast in order to obtain the desired conversion behavior.

Cast into an u32 box3d, truncating decimals if any.

When casting from floating point cuboids, it is worth considering whether to round(), round_in() or round_out() before the cast in order to obtain the desired conversion behavior.

Cast into an i32 box3d, truncating decimals if any.

When casting from floating point cuboids, it is worth considering whether to round(), round_in() or round_out() before the cast in order to obtain the desired conversion behavior.

Cast into an i64 box3d, truncating decimals if any.

When casting from floating point cuboids, it is worth considering whether to round(), round_in() or round_out() before the cast in order to obtain the desired conversion behavior.

Returns true if all members are finite.

Return a box3d with edges rounded to integer coordinates, such that the returned box3d has the same set of pixel centers as the original one. Values equal to 0.5 round up. Suitable for most places where integral device coordinates are needed, but note that any translation should be applied first to avoid pixel rounding errors. Note that this is not rounding to nearest integer if the values are negative. They are always rounding as floor(n + 0.5).

Return a box3d with faces/edges rounded to integer coordinates, such that the original box3d contains the resulting box3d.

Return a box3d with faces/edges rounded to integer coordinates, such that the original box3d is contained in the resulting box3d.

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

Returns the “default value” for a type. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

Performs the /= operation. Read more

Performs the /= operation. Read more

Converts to this type from the input type.

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

Performs the *= operation. Read more

Performs the *= operation. Read more

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

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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)

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.