Skip to content

BoundingBox ​

Methods ​

addBounds ​

Adds two bounding boxes together.

ArgumentTypeRequiredDescription
boundsBoundsYes
xMinnumberYes
xMaxnumberYes
yMinnumberYes
yMaxnumberYes
zMinnumberYes
zMaxnumberYes

addBounds ​

Adds two bounding boxes together.

ArgumentTypeRequiredDescription
boundsBoundsYes
xMinnumberYes
xMaxnumberYes
yMinnumberYes
yMaxnumberYes
zMinnumberYes
zMaxnumberYes

addPoint ​

Adds points to a bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes
xOrPointnumber or Array[Number] or TypedArrayYes
ynumberYes
znumberYes

addPoint ​

Adds points to a bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes
xnumberYes
ynumberYes
znumberYes

addPoints ​

Adds points to a bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes
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
boundsBoundsYes
point1Vector3Yes
point2Vector3Yes

computeCornerPoints ​

Computes the two corner points with min and max coords.

ArgumentTypeRequiredDescription
boundsBoundsYes
point1Vector3Yes
point2Vector3Yes

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. Not as fast as vtkPoints.getBounds() if u, v, w form a natural basis.

ArgumentTypeRequiredDescription
pointsvtkPointsYes
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

contains ​

Is a bbox contained in another bbox.

ArgumentTypeRequiredDescription
boundsBoundsYes
otherBoundsYes

contains ​

Is a bbox contained in another bbox.

ArgumentTypeRequiredDescription
boundsBoundsYes
otherBoundsYes

containsPoint ​

Does the bbox contain a given point.

ArgumentTypeRequiredDescription
boundsBoundsYes
xnumberYes
ynumberYes
znumberYes

containsPoint ​

Does the bbox contain a given point.

ArgumentTypeRequiredDescription
boundsBoundsYes
xnumberYes
ynumberYes
znumberYes

cutWithPlane ​

Does a plane intersect a boox.

ArgumentTypeRequiredDescription
boundsBoundsYes
originVector3Yes
normalVector3Yes

cutWithPlane ​

Does a plane intersect a boox.

ArgumentTypeRequiredDescription
boundsBoundsYes
originVector3Yes
normalVector3Yes

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

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 two bounds equal.

ArgumentTypeRequiredDescription
aBoundsYes
bBoundsYes

equals ​

Tests whether two bounds equal.

ArgumentTypeRequiredDescription
aBoundsYes
bBoundsYes

getCenter ​

Gets the center of a bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes

getCenter ​

Gets the center of a bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes

getCorners ​

Gets the corners of a bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes
cornersArray[Vector3]Yes

getCorners ​

Gets the corners of a bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes
cornersArray[Vector3]Yes

getDiagonalLength ​

Gets the diagonal length of the bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes

getDiagonalLength ​

Gets the diagonal length of the bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes

getDiagonalLength2 ​

Gets the squared diagonal length of the bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes

getDiagonalLength2 ​

Gets the squared diagonal length of the bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes

getLength ​

Gets the bounding box side length.

ArgumentTypeRequiredDescription
boundsBoundsYes
indexnumberYes

getLength ​

Gets the bounding box side length.

ArgumentTypeRequiredDescription
boundsBoundsYes
indexnumberYes

getLengths ​

Gets the lengths of all sides.

ArgumentTypeRequiredDescription
boundsBoundsYes

getLengths ​

Gets the lengths of all sides.

ArgumentTypeRequiredDescription
boundsBoundsYes

getMaxLength ​

Gets the maximum side length of the bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes

getMaxLength ​

Gets the maximum side length of the bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes

getMaxPoint ​

Gets the max point.

ArgumentTypeRequiredDescription
boundsBoundsYes

getMaxPoint ​

Gets the max point.

ArgumentTypeRequiredDescription
boundsBoundsYes

getMinPoint ​

Gets the min point.

ArgumentTypeRequiredDescription
boundsBoundsYes

getMinPoint ​

Gets the min point.

ArgumentTypeRequiredDescription
boundsBoundsYes

getXRange ​

Gets the x range of a bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes

getXRange ​

Gets the x range of a bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes

getYRange ​

Gets the y range of a bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes

getYRange ​

Gets the y range of a bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes

getZRange ​

Gets the z range of a bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes

getZRange ​

Gets the z range of a bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes

inflate ​

Inflates a bounding box.

ArgumentTypeRequiredDescription
deltanumberNoThe amount to inflate the bounding box by.

inflate ​

Inflates a bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes
deltanumberYes

intersect ​

Do two bounding boxes intersect.

ArgumentTypeRequiredDescription
boundsBoundsYes
bBoundsYes

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
boundsBoundsYes
originVector3Yes
dirVector3Yes
coordVector3Yes
tolerancenumberYes

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
boundsBoundsYes
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 ​

Do two bounding boxes intersect.

ArgumentTypeRequiredDescription
boundsBoundsYes
bBoundsBoundsYes

intersects ​

Do two bounding boxes intersect.

ArgumentTypeRequiredDescription
boundsBoundsYes
bBoundsBoundsYes

isValid ​

Tests whether a given bounds is valid.

ArgumentTypeRequiredDescription
boundsBoundsYes

isValid ​

Tests whether a given bounds is valid.

ArgumentTypeRequiredDescription
boundsBoundsYes

reset ​

Resets a bounds to infinity.

ArgumentTypeRequiredDescription
boundsBoundsYes

reset ​

Resets a bounds to infinity.

ArgumentTypeRequiredDescription
boundsBoundsYes

scale ​

Scales a bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes
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

scaleAboutCenter ​

Scales a bounding box around its center.

ArgumentTypeRequiredDescription
boundsBoundsYes
sxnumberYes
synumberYes
sznumberYes

setBounds ​

Sets a bounding box from another bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes
otherBoundsYes

setBounds ​

Sets a bounding box from another bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes
otherBoundsYes

setMaxPoint ​

Sets the max point of a bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes
xnumberYes
ynumberYes
znumberYes

setMaxPoint ​

Sets the max point of a bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes
xnumberYes
ynumberYes
znumberYes

setMinPoint ​

Sets the min point of a bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes
xnumberYes
ynumberYes
znumberYes

setMinPoint ​

Sets the min point of a bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes
xnumberYes
ynumberYes
znumberYes

transformBounds ​

Transforms a bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes
transformmat4Yes
outBoundsYes

transformBounds ​

Transforms a bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYes
transformmat4Yes
outBoundsYes