Bounding objects(qcip_tools.bounding
)
Bouding box/sphere.
API documentation
- class qcip_tools.bounding.AABoundingBox(origin, maximum=None, size=None)
Defines a Axis Aligned (AA) bounding box. You must define either
maximum
orsize
.Note
Works for any dimension.
Note
The
origin
is corrected so that is the lowest coordinates possible, anddimension
is set accordingly, so that it contains only positive numbers.- Parameters:
origin (list|numpy.ndarray) – the origin
maximum (list|numpy.ndarray) – the maximum
size (list|numpy.ndarray) – size of bounding box
- contains(coo)
Test if point in bounding box
- Parameters:
coo (list|numpy.ndarray) – coordinates of the point
- Return type:
bool
- maximum()
Returns the position of the maximum of the bounding box in “global” coordinates
- Return type:
numpy.ndarray
- update(coo)
Update the size of the bounding box to include a given point
- Parameters:
coo (list|numpy.ndarray) – coordinates of the point
- class qcip_tools.bounding.BoundingObject(origin)
Define a general bounding object
- Parameters:
origin (list|numpy.ndarray) – the origin
- contains(item)
Test if point in bounding box
- Parameters:
item (list|numpy.ndarray) – coordinates of the point
- Return type:
bool
- local_coordinates(coo)
Returns coordinates with respect to the origin of the bounding box
- Parameters:
coo (list|numpy.ndarray) – coordinates of the point
- Return type:
numpy.ndarray
- update(coo)
Update the size of the bounding box to include a given point
- Parameters:
coo (list|numpy.ndarray) – coordinates of the point
- class qcip_tools.bounding.BoundingSet
Define a set of bounding objects
- contains(item)
Test if point in the set
- Parameters:
item (list|numpy.ndarray|tuple) – coordinates of the point
- Return type:
bool
- exclude(bounding_object)
Add an object to the inclusion set
- Parameters:
bounding_object (BoundingObject) – object
- include(bounding_object)
Add an object to the inclusion set
- Parameters:
bounding_object (BoundingObject) – object
- class qcip_tools.bounding.BoundingSphere(origin, radius)
Define a bounding sphere
Note
Works for any dimension.
- Parameters:
origin (list|numpy.ndarray) – the origin
radius (float) – the radius
- contains(item, tolerance=0.001)
Test if point in bounding sphere
- Parameters:
item (list|numpy.ndarray) – coordinates of the point
tolerance (float) – threshold of tolerance
- Return type:
bool
- update(coo)
Update the radius of the bounding sphere to include a given point
- Parameters:
coo (list|numpy.ndarray) – coordinates of the point
- exception qcip_tools.bounding.DimensionAreNotEquals(var1='a', var2='b')