Box3D

Box3D represents an oriented bounding box in three-dimensional space. The box3d component is defined by the half-widths of the three box dimensions. By default the box will be centered at the origin and aligned with the axes. The box can be positioned within it's local space by providing the vec3d position, or a quaternion orientation.

It is compatible with AnnotationContext. class_id can be used to provide colors and labels from the annotation context. See examples in the AnnotationContext documentation.

Components and APIs

Primary component: box3d,

Secondary components: vec3d, quaternion, colorrgba, radius, label, classid

Python APIs: log_obb

Rust API: Box3D

Simple Example

"""Log a single oriented bounding box.""" import rerun as rr rr.init("rerun_example_box3d", spawn=True) rr.log_obb("simple", half_size=[2.0, 2.0, 1.0])

Batch Example

"""Log a batch of oriented bounding boxes.""" import rerun as rr from scipy.spatial.transform import Rotation rr.init("rerun_example_box3d", spawn=True) rr.log_annotation_context( "/", [ rr.ClassDescription(info=rr.AnnotationInfo(1, "red", (255, 0, 0))), rr.ClassDescription(info=rr.AnnotationInfo(2, "green", (0, 255, 0))), ], ) rr.log_obbs( "batch", half_sizes=[[2.0, 2.0, 1.0], [1.0, 1.0, 0.5]], rotations_q=[ Rotation.from_euler("xyz", [0, 0, 0]).as_quat(), Rotation.from_euler("xyz", [0, 0, 45]).as_quat(), ], positions=[[2, 0, 0], [-2, 0, 0]], stroke_widths=0.05, class_ids=[2, 1], )