Box

Box

Box

Constructor

new Box()

Members

area :double

Gets the total surface area of this box.
Type:
  • double

center :Array.<x, y, z>

Gets the point that is in the center of the box.
Type:
  • Array.<x, y, z>

isValid :bool

Gets the validity of this Box. Boxes are invalid when the base plane or any of the dimension intervals are invalid or decreasing.
Type:
  • bool

volume :double

Gets the total volume of this box.
Type:
  • double

Methods

closestPoint(point) → {Array.<x, y, z>}

Finds the closest point on or in the Box. The box should be Valid for this to work.
Parameters:
Name Type Description
point Array.<x, y, z> Sample point.
Returns:
The point on or in the box that is closest to the sample point.
Type
Array.<x, y, z>

pointAt(x, y, z) → {Array.<x, y, z>}

Evaluates the box volume at the given unitized parameters. The box has idealized side length of 1x1x1.
Parameters:
Name Type Description
x double Unitized parameter (between 0 and 1 is inside the box) along box X direction.
y double Unitized parameter (between 0 and 1 is inside the box) along box Y direction.
z double Unitized parameter (between 0 and 1 is inside the box) along box Z direction.
Returns:
The point at (x,y,z).
Type
Array.<x, y, z>

transform(xform) → {bool}

Transforms this Box using a Transformation matrix. If the Transform does not preserve Similarity, the dimensions of the resulting box cannot be trusted.
Parameters:
Name Type Description
xform Transform Transformation matrix to apply to this Box.
Returns:
true if the Box was successfully transformed, false if otherwise.
Type
bool