Box3 Values

The Box3 class describes a 3D box volume described by two 3d corner coordinates. The Box3 class provides methods that return individual coordinates of the box, scale and translate it, retrieve its center, modify its size, expand it to include points or other boxes, and determine if points are inside the box.

Constructors

Box3() 

Creates a new, empty Box3 object.

Box3 <min_Point3> <max_Point3>

Creates a new Box3 object defined by the min and max Point3 corners.

Properties

.min: Point3

The "minimum" corner of the Box3 value.

<Box3>.max: Point3

The "maximum" corner of the Box3 value

<Box3>.center: Point3 

The center of the Box3 volume; read-only.

Operators

<Box3> == <Box3>
<Box3> != <Box3>

Standard comparison operators. Two Box3 values are equal if all of their component values are equal.

<Box3> + (<Box3> | <point3> | <point3 array>)

: Expands the Box3 value to include the argument value. Available in in 3ds Max 2022 and later

Methods

contains <Box3> <Point3>

Returns true if the Point3 value is within the bounds of the Box3 volume.

empty <Box3>

Resets the Box3 value to an "empty" state with meaningless min and max values.

enlargeBy <Box3> <float>

Enlarges the Box3. A Point3 is created from the float f as Point3(f,f,f) and added to min and subtracted from max. If the box is 'empty', the Box3 is centered at (0,0,0) and then enlarged.

expandToInclude <Box3> (<Box3> | <point3> | <point3 array>) transform:<matrix3>

Enlarges the Box3 to include the specified argument value. The transform argument only applies if the value passed is a point3 array, and is applied to the elements of the array.

makeCube <Box3> <Point3> <float>

Modifies the specified Box3 such that its center is located at the specified <Point3> with equal sides with the specified <float> length.

Intersects <Box3> <Box3>

Returns true if the two Box3 values intersect.

isEmpty <Box3>

Returns true if the specified Box3 value is empty.

Scale <Box3> <float>

Scales the Box3 value about its center by the specified value.

Translate <Box3> <point3>

Translates the Box3 value by the specified distance. The point is added to each corner.

<Box3> copy <Box3>

Creates a copy of the box3 value.