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__(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(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()
→ hou.Vector3
Return a vector describing the corner of the box with the smallest x
,
y
, and z
values.
maxvec()
→ hou.Vector3
Return a vector describing the corner of the box with the largest x
,
y
, and z
values.
sizevec()
→ 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()
→ 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(point_or_bbox)
Enlarge the bounding box to contain the given element. The element may be a sequence of 3 floats (such as 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.
contains(point)
Given a sequence of 3 floats (such as a hou.Vector3) describing a position, return whether the position is inside the box.
isAlmostEqual(bbox, tolerance=0.00001)
→ bool
Returns whether this bounding box is equal to another, subject to numerical tolerances.
isValid()
→ bool
Returns whether this bounding box is valid.
__mul__(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.