Boxes3D
Represents 3D axis-aligned or oriented bounding boxes defined by half-extents, centers, and optional Euler-angle rotations. This datatype is used for 3D regions of interest, object extents, and operations such as filtering by bounding box within the Telekinesis ecosystem.
Field
Required
| Field | Type | Description |
|---|---|---|
half_sizes | ArrayLike | Half-extents of each box; shape (3,) or (N, 3), dtype float32. |
centers | ArrayLike | Centers of each box; shape (3,) or (N, 3), dtype float32. |
Optional
| Field | Type | Description |
|---|---|---|
rotations_in_euler_angle | ArrayLike | Rotations in Euler angles (radians or degrees per implementation); shape (3,) or (N, 3), dtype float32. Default [0, 0, 0]. |
half_sizes and centers must have the same number of rows. If rotations_in_euler_angle has one row, it is broadcast to all boxes.
Methods
| Method | Description |
|---|---|
to_dict() | Returns a dictionary with keys: half_sizes, centers, and optionally rotations_in_euler_angle. Values are the stored arrays. |
Example
From the datatypes examples:
python
from datatypes import datatypes
from loguru import logger
# ------------------------------------------------
# 1. Create Boxes3D instance
# ------------------------------------------------
boxes_3d = datatypes.Boxes3D(
half_sizes=[[1, 2, 3], [4, 5, 6], [7, 8, 9]],
centers=[[0.0, 0.0, 0.0], [1.0, 1.0, 1.0], [2.0, 2.0, 2.0]],
rotations_in_euler_angle=[[0.0, 0.0, 0.0]],
)
# ------------------------------------------------
# 2. Access data via to_dict
# ------------------------------------------------
data = boxes_3d.to_dict()
logger.info("Boxes3D to_dict half_sizes={}", data["half_sizes"])
logger.info("Boxes3D to_dict centers={}", data["centers"])
logger.info("Boxes3D to_dict rotations_in_euler_angle={}", data["rotations_in_euler_angle"])
