Box3 Values

Value > Basic Data Values > Box3 Values

 

   

Values and Collections - Quick Navigation

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

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

   

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> <Point3>

Enlarges the Box3 to include the specified Point3.

   

makeCube <Point3> <float>

Modifies the 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> <float>

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

   

See Also