LeafTransforms3D

One or more transforms between the parent and the current entity which are not propagated in the transform hierarchy.

For transforms that are propagated in the transform hierarchy, see archetypes.Transform3D.

If both archetypes.LeafTransforms3D and archetypes.Transform3D are present, first the tree propagating archetypes.Transform3D is applied, then archetypes.LeafTransforms3D.

Currently, most visualizers support only a single leaf transform per entity. Check archetype documentations for details - if not otherwise specified, only the first leaf transform is applied.

From the point of view of the entity's coordinate system, all components are applied in the inverse order they are listed here. E.g. if both a translation and a max3x3 transform are present, the 3x3 matrix is applied first, followed by the translation.

Components components

Optional: LeafTranslation3D, LeafRotationAxisAngle, LeafRotationQuat, LeafScale3D, LeafTransformMat3x3

Shown in shown-in

Example example

Regular & leaf transform in tandom regular--leaf-transform-in-tandom

"""Log a simple 3D box with a regular & leaf transform."""

import numpy as np
import rerun as rr

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

rr.set_time_sequence("frame", 0)

# Log a box and points further down in the hierarchy.
rr.log("world/box", rr.Boxes3D(half_sizes=[[1.0, 1.0, 1.0]]))
rr.log("world/box/points", rr.Points3D(np.vstack([xyz.ravel() for xyz in np.mgrid[3 * [slice(-10, 10, 10j)]]]).T))

for i in range(0, 180):
    rr.set_time_sequence("frame", i)

    # Log a regular transform which affects both the box and the points.
    rr.log("world/box", rr.Transform3D(rotation_axis_angle=rr.RotationAxisAngle([0, 0, 1], angle=rr.Angle(deg=i * 2))))

    # Log an leaf transform which affects only the box.
    rr.log("world/box", rr.LeafTransforms3D(translations=[0, 0, abs(i * 0.1 - 5.0) - 5.0]))