Boxes3D

3D boxes with half-extents and optional center, rotations, colors etc.

Note that orienting and placing the box is handled via [archetypes.InstancePoses3D]. Some of its component are repeated here for convenience. If there's more instance poses than half sizes, the last half size will be repeated for the remaining poses.

Components components

Required: HalfSize3D

Recommended: PoseTranslation3D, Color

Optional: PoseRotationAxisAngle, PoseRotationQuat, Radius, FillMode, Text, ClassId

Shown in shown-in

Examples examples

Simple 3D boxes simple-3d-boxes

"""Log a single 3D Box."""

import rerun as rr

rr.init("rerun_example_box3d", spawn=True)

rr.log("simple", rr.Boxes3D(half_sizes=[2.0, 2.0, 1.0]))

Batch of 3D boxes batch-of-3d-boxes

"""Log a batch of oriented bounding boxes."""

import rerun as rr

rr.init("rerun_example_box3d_batch", spawn=True)

rr.log(
    "batch",
    rr.Boxes3D(
        centers=[[2, 0, 0], [-2, 0, 0], [0, 0, 2]],
        half_sizes=[[2.0, 2.0, 1.0], [1.0, 1.0, 0.5], [2.0, 0.5, 1.0]],
        quaternions=[
            rr.Quaternion.identity(),
            rr.Quaternion(xyzw=[0.0, 0.0, 0.382683, 0.923880]),  # 45 degrees around Z
        ],
        radii=0.025,
        colors=[(255, 0, 0), (0, 255, 0), (0, 0, 255)],
        fill_mode="solid",
        labels=["red", "green", "blue"],
    ),
)