Skip to content

BoundingBox ​

Methods ​

addBounds ​

Adds another bounding box to this one.

ArgumentTypeRequiredDescription
xMinnumberYes
xMaxnumberYes
yMinnumberYes
yMaxnumberYes
zMinnumberYes
zMaxnumberYes

addBounds ​

Adds two bounding boxes together.

ArgumentTypeRequiredDescription
boundsBoundsYes
xMinnumberYes
xMaxnumberYes
yMinnumberYes
yMaxnumberYes
zMinnumberYes
zMaxnumberYes

addPoint ​

Adds a point to this bounding box.

ArgumentTypeRequiredDescription
xOrPointnumber or Array[Number] or TypedArrayYes
ynumberYes
znumberYes

addPoint ​

Adds points to a bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes
xnumberYes
ynumberYes
znumberYes

addPoints ​

Adds points to this bounding box.

ArgumentTypeRequiredDescription
pointsArray[number]YesA flattened array of 3D coordinates.

addPoints ​

Adds points to a bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes
pointsArray[number]YesA flattened array of 3D coordinates.

clampDivisions ​

Clamp the divisions to ensure the total number doesn't exceed targetBins

ArgumentTypeRequiredDescription
targetBinsNumberYes- Maximum number of bins allowed
divsArray[Number]Yes- Divisions array to adjust [divX, divY, divZ]

computeCornerPoints ​

Computes the two corner points with min and max coords.

ArgumentTypeRequiredDescription
point1Vector3Yes
point2Vector3Yes

computeCornerPoints ​

Computes the two corner points with min and max coords.

ArgumentTypeRequiredDescription
boundsBoundsYes
point1Vector3Yes
point2Vector3Yes

computeDivisions ​

Compute the number of divisions given this bounding box and a target number of buckets/bins. Handles degenerate bounding boxes properly.

ArgumentTypeRequiredDescription
totalBinsNumberYes- Target number of bins
divsArray[Number]Yes- Output array to store divisions [divX, divY, divZ]
adjustedBoundsBoundsNo- Output array to store adjusted bounds if needed

Returns ​

TypeDescription
NumberThe actual total number of bins

computeDivisions ​

Compute the number of divisions given the current bounding box and a target number of buckets/bins. Handles degenerate bounding boxes properly.

ArgumentTypeRequiredDescription
boundsBoundsYes- The bounding box
totalBinsNumberYes- Target number of bins
divsArray[Number]Yes- Output array to store divisions [divX, divY, divZ]
adjustedBoundsBoundsNo- Output array to store adjusted bounds if needed

Returns ​

TypeDescription
NumberThe actual total number of bins

computeLocalBounds ​

Compute local bounds along the given basis.

ArgumentTypeRequiredDescription
uarrayYesfirst vector
varrayYessecond vector
warrayYesthird vector

computeLocalBounds ​

Compute local bounds. Not as fast as vtkPoints.getBounds() if u, v, w form a natural basis.

ArgumentTypeRequiredDescription
pointsvtkPointsYes
uarrayYesfirst vector
varrayYessecond vector
warrayYesthird vector

computeScale3 ​

Computes the half lengths of this bounding box.

ArgumentTypeRequiredDescription
scale3Vector3No

contains ​

Is another bounding box contained in this one.

ArgumentTypeRequiredDescription
otherBoundsBoundsYes

contains ​

Is a bbox contained in another bbox.

ArgumentTypeRequiredDescription
boundsBoundsYes
otherBoundsYes

containsPoint ​

Does this bounding box contain a given point.

ArgumentTypeRequiredDescription
xnumberYes
ynumberYes
znumberYes

containsPoint ​

Does the bbox contain a given point.

ArgumentTypeRequiredDescription
boundsBoundsYes
xnumberYes
ynumberYes
znumberYes

cutWithPlane ​

Does a plane cut this bounding box.

ArgumentTypeRequiredDescription
originVector3Yes
normalVector3Yes

cutWithPlane ​

Does a plane intersect a boox.

ArgumentTypeRequiredDescription
boundsBoundsYes
originVector3Yes
normalVector3Yes

distance2ToBounds ​

Calculate the squared distance from point x to this bounding box.

ArgumentTypeRequiredDescription
xVector3YesThe point coordinates

Returns ​

TypeDescription
NumberThe squared distance to the bounds

distance2ToBounds ​

Calculate the squared distance from point x to the specified bounds.

ArgumentTypeRequiredDescription
xVector3YesThe point coordinates
boundsBoundsYesThe bounding box coordinates

Returns ​

TypeDescription
NumberThe squared distance to the bounds

equals ​

Tests whether the given bounds equal this one.

ArgumentTypeRequiredDescription
otherBoundsBoundsYes

equals ​

Tests whether two bounds equal.

ArgumentTypeRequiredDescription
aBoundsYes
bBoundsYes

getCenter ​

Gets the center of this bounding box.

getCenter ​

Gets the center of a bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes

getCorners ​

Gets the corners of this bounding box.

ArgumentTypeRequiredDescription
cornersArray[Vector3]Yes

getCorners ​

Gets the corners of a bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes
cornersArray[Vector3]Yes

getDiagonalLength ​

Gets the diagonal length of this bounding box.

getDiagonalLength ​

Gets the diagonal length of the bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes

getDiagonalLength2 ​

Gets the squared diagonal length of this bounding box.

getDiagonalLength2 ​

Gets the squared diagonal length of the bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes

getLength ​

Gets a side length of this bounding box.

ArgumentTypeRequiredDescription
indexnumberYes

getLength ​

Gets the bounding box side length.

ArgumentTypeRequiredDescription
boundsBoundsYes
indexnumberYes

getLengths ​

Gets the lengths of all sides.

getLengths ​

Gets the lengths of all sides.

ArgumentTypeRequiredDescription
boundsBoundsYes

getMaxLength ​

Gets the maximum side length of this bounding box.

getMaxLength ​

Gets the maximum side length of the bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes

getMaxPoint ​

Gets the max point.

getMaxPoint ​

Gets the max point.

ArgumentTypeRequiredDescription
boundsBoundsYes

getMinPoint ​

Gets the min point.

getMinPoint ​

Gets the min point.

ArgumentTypeRequiredDescription
boundsBoundsYes

getXRange ​

Gets the x range of this bounding box.

getXRange ​

Gets the x range of a bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes

getYRange ​

Gets the y range of this bounding box.

getYRange ​

Gets the y range of a bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes

getZRange ​

Gets the z range of this bounding box.

getZRange ​

Gets the z range of a bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes

inflate ​

Inflates this bounding box.

ArgumentTypeRequiredDescription
deltanumberNoThe amount to inflate the bounding box by.

intersect ​

Intersect this bounding box with another one, storing the result in this one.

ArgumentTypeRequiredDescription
otherBoundsBoundsYes

intersect ​

Do two bounding boxes intersect.

ArgumentTypeRequiredDescription
boundsBoundsYes
bBoundsYes

intersectBox ​

The method returns a non-zero value if the bounding box is hit. Origin[3] starts the ray, dir[3] is the vector components of the ray in the x-y-z directions, coord[3] is the location of hit, and t is the parametric coordinate along line. (Notes: the intersection ray dir[3] is NOT normalized. Valid intersections will only occur between 0<=t<=1.)

ArgumentTypeRequiredDescription
originVector3Yes
dirVector3Yes
coordVector3Yes
toleranceArray[number]Yes

intersectBox ​

The method returns a non-zero value if the bounding box is hit. Origin[3] starts the ray, dir[3] is the vector components of the ray in the x-y-z directions, coord[3] is the location of hit, and t is the parametric coordinate along line. (Notes: the intersection ray dir[3] is NOT normalized. Valid intersections will only occur between 0<=t<=1.)

ArgumentTypeRequiredDescription
boundsBoundsYes
originVector3Yes
dirVector3Yes
coordVector3Yes
tolerancenumberYes

intersectPlane ​

Plane intersection with box The plane is infinite in extent and defined by an origin and normal.The function indicates whether the plane intersects, not the particulars of intersection points and such The function returns non-zero if the plane and box intersect; zero otherwise.

ArgumentTypeRequiredDescription
originVector3Yes
normalVector3Yes

intersectPlane ​

Plane intersection with box The plane is infinite in extent and defined by an origin and normal.The function indicates whether the plane intersects, not the particulars of intersection points and such The function returns non-zero if the plane and box intersect; zero otherwise.

ArgumentTypeRequiredDescription
boundsBoundsYes
originVector3Yes
normalVector3Yes

intersects ​

Does another bounding box intersect this one.

ArgumentTypeRequiredDescription
otherBoundsBoundsYes

intersects ​

Do two bounding boxes intersect.

ArgumentTypeRequiredDescription
boundsBoundsYes
bBoundsBoundsYes

isValid ​

Tests whether this bounding box is valid.

isValid ​

Tests whether a given bounds is valid.

ArgumentTypeRequiredDescription
boundsBoundsYes

reset ​

Resets this bounds to infinity.

reset ​

Resets a bounds to infinity.

ArgumentTypeRequiredDescription
boundsBoundsYes

scale ​

Scales this bounding box.

ArgumentTypeRequiredDescription
sxnumberYes
synumberYes
sznumberYes

scale ​

Scales a bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes
sxnumberYes
synumberYes
sznumberYes

scaleAboutCenter ​

Scales a bounding box around its center.

ArgumentTypeRequiredDescription
boundsBoundsYes
sxnumberYes
synumberYes
sznumberYes

setBounds ​

Sets this bounding box from another bounding box.

ArgumentTypeRequiredDescription
otherBoundsBoundsYes

setBounds ​

Sets a bounding box from another bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes
otherBoundsYes

setMaxPoint ​

Sets the max point of this bounding box.

ArgumentTypeRequiredDescription
xnumberYes
ynumberYes
znumberYes

setMaxPoint ​

Sets the max point of a bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes
xnumberYes
ynumberYes
znumberYes

setMinPoint ​

Sets the min point of this bounding box.

ArgumentTypeRequiredDescription
xnumberYes
ynumberYes
znumberYes

setMinPoint ​

Sets the min point of a bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes
xnumberYes
ynumberYes
znumberYes

transformBounds ​

Transforms this bounding box.

ArgumentTypeRequiredDescription
transformmat4Yes
outBoundsNo

transformBounds ​

Transforms a bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes
transformmat4Yes
outBoundsYes