hou.BoundingBox class

An axis-aligned 3D rectangular region.

For example, a bounding box might describe a piece of geometry’s minimum and maximum values on each of the coordinate axes. See hou.Geometry.boundingBox for an example of a function that returns a bounding box.

Methods

__init__(self, xmin=0.0, ymin=0.0, zmin=0.0, xmax=0.0, ymax=0.0, zmax=0.0)

Construct a new bounding box with the specified minimum and maximum bounds. Use hou.BoundingBox.setTo to change the position of an existing bounding box.

setTo(self, bounds_sequence)

Given a sequence of (xmin, ymin, zmin, xmax, ymax, zmax) values, set the position of the bounding box.

Raises hou.InvalidSize if the tuple does not contain six elements.

minvec(self)hou.Vector3

Return a vector describing the corner of the box with the smallest x, y, and z values.

maxvec(self)hou.Vector3

Return a vector describing the corner of the box with the largest x, y, and z values.

sizevec(self)hou.Vector3

Return a vector describing the size of the box in each of the x, y, and z axes.

This method can be implemented as follows:

def sizevec(self):
    return self.maxvec() - self.minvec()

center(self)hou.Vector3

Return the position of the center of the bounding box.

This method can be implemented as follows:

def sizevec(self):
    return (self.minvec() + self.maxvec()) * 0.5

enlargeToContain(self, point_or_bbox)

Enlarge the bounding box to contain the given element. The element may be a hou.Vector3 describing a position or another bounding box. If this box does not need to grow because it already completely contains the element, it won’t be modified.

isAlmostEqual(self, bbox, tolerance=0.00001)bool

Returns whether this bounding box is equal to another, subject to numerical tolerances.

__mul__(self, matrix4)BoundingBox

Take this bounding box, transform it by the given matrix, compute the axis-aligned bounding box around this transformed box, and return it.