BoundingBox class
BoundingBox class
The axis-aligned bounding box
The BoundingBox type exposes the following members:
Constructors
| Constructor | Description |
|---|---|
__init__(self, minimum, maximum) | Initialize a finite bounding box with given minimum and maximum corner |
__init__(self, min_x, min_y, min_z, max_x, max_y, max_z) | Initialize a finite bounding box with given minimum and maximum corner |
__init__(self) | Constructs a new instance of BoundingBox |
Properties
| Property | Description |
|---|---|
| null | The null bounding box |
| infinite | The infinite bounding box |
| extent | Gets the extent of the bounding box. |
| minimum | The minimum corner of the bounding box |
| maximum | The maximum corner of the bounding box |
| size | The size of the bounding box |
| center | The center of the bounding box. |
Methods
| Method | Description |
|---|---|
merge(self, pt) | Merge current bounding box with given point |
merge(self, pt) | Merge current bounding box with given point |
merge(self, x, y, z) | Merge current bounding box with given point |
merge(self, bb) | Merges the new box into the current bounding box. |
contains(self, p) | Check if the point p is inside the bounding box |
contains(self, bbox) | The bounding box to check if it’s inside current bounding box. |
scale(self) | Calculates the absolute largest coordinate value of any contained point. |
from_geometry(, geometry) | Construct a bounding box from given geometry |
overlaps_with(self, box) | Check if current bounding box overlaps with specified bounding box. |
Example
The following code shows how to get a bounding box from an Entity instance.
from aspose.threed.entities import Sphere
sphere = Sphere()
boundingBox = sphere.get_bounding_box()
print("Bounding box = " + str(boundingBox))
See Also
- module
aspose.threed.utilities