Skip to content

Archetypes

rerun.archetypes

class AnnotationContext

Bases: Archetype

Archetype: The annotation context provides additional information on how to display entities.

Entities can use components.ClassIds and components.KeypointIds to provide annotations, and the labels and colors will be looked up in the appropriate annotation context. We use the first annotation context we find in the path-hierarchy when searching up through the ancestors of a given entity path.

See also datatypes.ClassDescription.

Example
Segmentation:

import numpy as np
import rerun as rr

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

# Create a simple segmentation image
image = np.zeros((200, 300), dtype=np.uint8)
image[50:100, 50:120] = 1
image[100:180, 130:280] = 2

# Log an annotation context to assign a label and color to each class
rr.log("segmentation", rr.AnnotationContext([(1, "red", (255, 0, 0)), (2, "green", (0, 255, 0))]), static=True)

rr.log("segmentation/image", rr.SegmentationImage(image))

def __init__(context)

Create a new instance of the AnnotationContext archetype.

PARAMETER DESCRIPTION
context

List of class descriptions, mapping class indices to class names, colors etc.

TYPE: AnnotationContextLike

class Arrows2D

Bases: Arrows2DExt, Archetype

Archetype: 2D arrows with optional colors, radii, labels, etc.

Example
Simple batch of 2D arrows:

import rerun as rr

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

rr.log(
    "arrows",
    rr.Arrows2D(
        origins=[[0.25, 0.0], [0.25, 0.0], [-0.1, -0.1]],
        vectors=[[1.0, 0.0], [0.0, -1.0], [-0.7, 0.7]],
        colors=[[255, 0, 0], [0, 255, 0], [127, 0, 255]],
        labels=["right", "up", "left-down"],
        radii=0.025,
    ),
)

def __init__(*, vectors, origins=None, radii=None, colors=None, labels=None, class_ids=None)

Create a new instance of the Arrows2D archetype.

PARAMETER DESCRIPTION
vectors

All the vectors for each arrow in the batch.

TYPE: Vec2DArrayLike

origins

All the origin points for each arrow in the batch.

If no origins are set, (0, 0, 0) is used as the origin for each arrow.

TYPE: Vec2DArrayLike | None DEFAULT: None

radii

Optional radii for the arrows.

The shaft is rendered as a line with radius = 0.5 * radius. The tip is rendered with height = 2.0 * radius and radius = 1.0 * radius.

TYPE: Float32ArrayLike | None DEFAULT: None

colors

Optional colors for the points.

TYPE: Rgba32ArrayLike | None DEFAULT: None

labels

Optional text labels for the arrows.

TYPE: Utf8ArrayLike | None DEFAULT: None

class_ids

Optional class Ids for the points.

The class ID provides colors and labels if not specified explicitly.

TYPE: ClassIdArrayLike | None DEFAULT: None

class Arrows3D

Bases: Arrows3DExt, Archetype

Archetype: 3D arrows with optional colors, radii, labels, etc.

Example
Simple batch of 3D arrows:

from math import tau

import numpy as np
import rerun as rr

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

lengths = np.log2(np.arange(0, 100) + 1)
angles = np.arange(start=0, stop=tau, step=tau * 0.01)
origins = np.zeros((100, 3))
vectors = np.column_stack([np.sin(angles) * lengths, np.zeros(100), np.cos(angles) * lengths])
colors = [[1.0 - c, c, 0.5, 0.5] for c in angles / tau]

rr.log("arrows", rr.Arrows3D(origins=origins, vectors=vectors, colors=colors))

def __init__(*, vectors, origins=None, radii=None, colors=None, labels=None, class_ids=None)

Create a new instance of the Arrows3D archetype.

PARAMETER DESCRIPTION
vectors

All the vectors for each arrow in the batch.

TYPE: Vec3DArrayLike

origins

All the origin points for each arrow in the batch.

If no origins are set, (0, 0, 0) is used as the origin for each arrow.

TYPE: Vec3DArrayLike | None DEFAULT: None

radii

Optional radii for the arrows.

The shaft is rendered as a line with radius = 0.5 * radius. The tip is rendered with height = 2.0 * radius and radius = 1.0 * radius.

TYPE: Float32ArrayLike | None DEFAULT: None

colors

Optional colors for the points.

TYPE: Rgba32ArrayLike | None DEFAULT: None

labels

Optional text labels for the arrows.

TYPE: Utf8ArrayLike | None DEFAULT: None

class_ids

Optional class Ids for the points.

The class ID provides colors and labels if not specified explicitly.

TYPE: ClassIdArrayLike | None DEFAULT: None

class Asset3D

Bases: Asset3DExt, Archetype

Archetype: A prepacked 3D asset (.gltf, .glb, .obj, .stl, etc.).

See also archetypes.Mesh3D.

If there are multiple archetypes.InstancePoses3D instances logged to the same entity as a mesh, an instance of the mesh will be drawn for each transform.

Example
Simple 3D asset:

import sys

import rerun as rr

if len(sys.argv) < 2:
    print(f"Usage: {sys.argv[0]} <path_to_asset.[gltf|glb|obj|stl]>")
    sys.exit(1)

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

rr.log("world", rr.ViewCoordinates.RIGHT_HAND_Z_UP, static=True)  # Set an up-axis
rr.log("world/asset", rr.Asset3D(path=sys.argv[1]))

def __init__(*, path=None, contents=None, media_type=None)

Create a new instance of the Asset3D archetype.

PARAMETER DESCRIPTION
path

A path to an file stored on the local filesystem. Mutually exclusive with contents.

TYPE: str | Path | None DEFAULT: None

contents

The contents of the file. Can be a BufferedReader, BytesIO, or bytes. Mutually exclusive with path.

TYPE: BlobLike | None DEFAULT: None

media_type

The Media Type of the asset.

For instance: * model/gltf-binary * model/gltf+json * model/obj * model/stl

If omitted, it will be guessed from the path (if any), or the viewer will try to guess from the contents (magic header). If the media type cannot be guessed, the viewer won't be able to render the asset.

TYPE: Utf8Like | None DEFAULT: None

class BarChart

Bases: BarChartExt, Archetype

Archetype: A bar chart.

The x values will be the indices of the array, and the bar heights will be the provided values.

Example
Simple bar chart:

import rerun as rr

rr.init("rerun_example_bar_chart", spawn=True)
rr.log("bar_chart", rr.BarChart([8, 4, 0, 9, 1, 4, 1, 6, 9, 0]))

def __init__(values, *, color=None)

Create a new instance of the BarChart archetype.

PARAMETER DESCRIPTION
values

The values. Should always be a 1-dimensional tensor (i.e. a vector).

TYPE: TensorDataLike

color

The color of the bar chart

TYPE: Rgba32Like | None DEFAULT: None

class Boxes2D

Bases: Boxes2DExt, Archetype

Archetype: 2D boxes with half-extents and optional center, colors etc.

Example
Simple 2D boxes:

import rerun as rr

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

rr.log("simple", rr.Boxes2D(mins=[-1, -1], sizes=[2, 2]))

def __init__(*, sizes=None, mins=None, half_sizes=None, centers=None, array=None, array_format=None, radii=None, colors=None, labels=None, draw_order=None, class_ids=None)

Create a new instance of the Boxes2D archetype.

PARAMETER DESCRIPTION
sizes

Full extents in x/y. Incompatible with array and half_sizes.

TYPE: Vec2DArrayLike | None DEFAULT: None

half_sizes

All half-extents that make up the batch of boxes. Specify this instead of sizes Incompatible with array and sizes.

TYPE: Vec2DArrayLike | None DEFAULT: None

mins

Minimum coordinates of the boxes. Specify this instead of centers. Incompatible with array. Only valid when used together with either sizes or half_sizes.

TYPE: Vec2DArrayLike | None DEFAULT: None

array

An array of boxes in the format specified by array_format. Requires specifying array_format. Incompatible with sizes, half_sizes, mins and centers.

TYPE: ArrayLike | None DEFAULT: None

array_format

How to interpret the data in array.

TYPE: Box2DFormat | None DEFAULT: None

centers

Optional center positions of the boxes.

TYPE: Vec2DArrayLike | None DEFAULT: None

colors

Optional colors for the boxes.

TYPE: Rgba32ArrayLike | None DEFAULT: None

radii

Optional radii for the lines that make up the boxes.

TYPE: Float32ArrayLike | None DEFAULT: None

labels

Optional text labels for the boxes.

TYPE: Utf8ArrayLike | None DEFAULT: None

draw_order

An optional floating point value that specifies the 2D drawing order. Objects with higher values are drawn on top of those with lower values.

The default for 2D boxes is 10.0.

TYPE: Float32ArrayLike | None DEFAULT: None

class_ids

Optional ClassIds for the boxes.

The class ID provides colors and labels if not specified explicitly.

TYPE: ClassIdArrayLike | None DEFAULT: None

class Boxes3D

Bases: Boxes3DExt, Archetype

Archetype: 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.

Example
Batch of 3D 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"],
    ),
)

def __init__(*, sizes=None, mins=None, half_sizes=None, centers=None, rotation_axis_angles=None, quaternions=None, rotations=None, colors=None, radii=None, fill_mode=None, labels=None, class_ids=None)

Create a new instance of the Boxes3D archetype.

PARAMETER DESCRIPTION
sizes

Full extents in x/y/z. Specify this instead of half_sizes

TYPE: Vec3DArrayLike | None DEFAULT: None

half_sizes

All half-extents that make up the batch of boxes. Specify this instead of sizes

TYPE: Vec3DArrayLike | None DEFAULT: None

mins

Minimum coordinates of the boxes. Specify this instead of centers.

Only valid when used together with either sizes or half_sizes.

TYPE: Vec3DArrayLike | None DEFAULT: None

centers

Optional center positions of the boxes.

If not specified, the centers will be at (0, 0, 0). Note that this uses a components.PoseTranslation3D which is also used by archetypes.InstancePoses3D.

TYPE: Vec3DArrayLike | None DEFAULT: None

rotation_axis_angles

Rotations via axis + angle.

If no rotation is specified, the axes of the boxes align with the axes of the local coordinate system. Note that this uses a components.PoseRotationAxisAngle which is also used by archetypes.InstancePoses3D.

TYPE: RotationAxisAngleArrayLike | None DEFAULT: None

quaternions

Rotations via quaternion.

If no rotation is specified, the axes of the boxes align with the axes of the local coordinate system. Note that this uses a components.PoseRotationQuat which is also used by archetypes.InstancePoses3D.

TYPE: QuaternionArrayLike | None DEFAULT: None

rotations

Backwards compatible parameter for specifying rotations. Tries to infer the type of rotation from the input. Prefer using quaternions or rotation_axis_angles.

TYPE: RotationAxisAngleArrayLike | QuaternionArrayLike | None DEFAULT: None

colors

Optional colors for the boxes.

TYPE: Rgba32ArrayLike | None DEFAULT: None

radii

Optional radii for the lines that make up the boxes.

TYPE: Float32ArrayLike | None DEFAULT: None

fill_mode

Optionally choose whether the boxes are drawn with lines or solid.

TYPE: FillMode | None DEFAULT: None

labels

Optional text labels for the boxes.

TYPE: Utf8ArrayLike | None DEFAULT: None

class_ids

Optional ClassIds for the boxes.

The class ID provides colors and labels if not specified explicitly.

TYPE: ClassIdArrayLike | None DEFAULT: None

class Clear

Bases: ClearExt, Archetype

Archetype: Empties all the components of an entity.

The presence of a clear means that a latest-at query of components at a given path(s) will not return any components that were logged at those paths before the clear. Any logged components after the clear are unaffected by the clear.

This implies that a range query that includes time points that are before the clear, still returns all components at the given path(s). Meaning that in practice clears are ineffective when making use of visible time ranges. Scalar plots are an exception: they track clears and use them to represent holes in the data (i.e. discontinuous lines).

Example
Flat:

import rerun as rr

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

vectors = [(1.0, 0.0, 0.0), (0.0, -1.0, 0.0), (-1.0, 0.0, 0.0), (0.0, 1.0, 0.0)]
origins = [(-0.5, 0.5, 0.0), (0.5, 0.5, 0.0), (0.5, -0.5, 0.0), (-0.5, -0.5, 0.0)]
colors = [(200, 0, 0), (0, 200, 0), (0, 0, 200), (200, 0, 200)]

# Log a handful of arrows.
for i, (vector, origin, color) in enumerate(zip(vectors, origins, colors)):
    rr.log(f"arrows/{i}", rr.Arrows3D(vectors=vector, origins=origin, colors=color))

# Now clear them, one by one on each tick.
for i in range(len(vectors)):
    rr.log(f"arrows/{i}", rr.Clear(recursive=False))  # or `rr.Clear.flat()`

def __init__(*, recursive)

Create a new instance of the Clear archetype.

PARAMETER DESCRIPTION
recursive

Whether to recursively clear all children.

TYPE: bool

def flat() staticmethod

Returns a non-recursive clear archetype.

This will empty all components of the associated entity at the logged timepoint. Children will be left untouched.

def recursive() staticmethod

Returns a recursive clear archetype.

This will empty all components of the associated entity at the logged timepoint, as well as all components of all its recursive children.

class DepthImage

Bases: DepthImageExt, Archetype

Archetype: A depth image, i.e. as captured by a depth camera.

Each pixel corresponds to a depth value in units specified by components.DepthMeter.

Example
Depth to 3D example:

import numpy as np
import rerun as rr

depth_image = 65535 * np.ones((200, 300), dtype=np.uint16)
depth_image[50:150, 50:150] = 20000
depth_image[130:180, 100:280] = 45000

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

# If we log a pinhole camera model, the depth gets automatically back-projected to 3D
rr.log(
    "world/camera",
    rr.Pinhole(
        width=depth_image.shape[1],
        height=depth_image.shape[0],
        focal_length=200,
    ),
)

# Log the tensor.
rr.log("world/camera/depth", rr.DepthImage(depth_image, meter=10_000.0, colormap="viridis"))

class DisconnectedSpace

Bases: DisconnectedSpaceExt, Archetype

Archetype: Spatially disconnect this entity from its parent.

Specifies that the entity path at which this is logged is spatially disconnected from its parent, making it impossible to transform the entity path into its parent's space and vice versa. It only applies to space views that work with spatial transformations, i.e. 2D & 3D space views. This is useful for specifying that a subgraph is independent of the rest of the scene.

Example
Disconnected space:

import rerun as rr

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

# These two points can be projected into the same space..
rr.log("world/room1/point", rr.Points3D([[0, 0, 0]]))
rr.log("world/room2/point", rr.Points3D([[1, 1, 1]]))

# ..but this one lives in a completely separate space!
rr.log("world/wormhole", rr.DisconnectedSpace())
rr.log("world/wormhole/point", rr.Points3D([[2, 2, 2]]))

def __init__(is_disconnected=True)

Disconnect an entity from its parent.

PARAMETER DESCRIPTION
is_disconnected

Whether or not the entity should be disconnected from the rest of the scene. Set to True to disconnect the entity from its parent. Set to False to disable the effects of this archetype, (re-)connecting the entity to its parent again.

TYPE: BoolLike DEFAULT: True

class Ellipsoids3D

Bases: Ellipsoids3DExt, Archetype

Archetype: 3D ellipsoids or spheres.

This archetype is for ellipsoids or spheres whose size is a key part of the data (e.g. a bounding sphere). For points whose radii are for the sake of visualization, use archetypes.Points3D instead.

Note that orienting and placing the ellipsoids/spheres 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.

def __init__(*, half_sizes=None, radii=None, centers=None, rotation_axis_angles=None, quaternions=None, colors=None, line_radii=None, fill_mode=None, labels=None, class_ids=None)

Create a new instance of the Ellipsoids3D archetype.

PARAMETER DESCRIPTION
half_sizes

All half-extents that make up the batch of ellipsoids. Specify this instead of radii

TYPE: Vec3DArrayLike | None DEFAULT: None

radii

All radii that make up this batch of spheres. Specify this instead of half_sizes

TYPE: Float32ArrayLike | None DEFAULT: None

centers

Optional center positions of the ellipsoids.

TYPE: Vec3DArrayLike | None DEFAULT: None

rotation_axis_angles

Rotations via axis + angle.

If no rotation is specified, the axes of the boxes align with the axes of the local coordinate system. Note that this uses a components.PoseRotationAxisAngle which is also used by archetypes.InstancePoses3D.

TYPE: RotationAxisAngleArrayLike | None DEFAULT: None

quaternions

Rotations via quaternion.

If no rotation is specified, the axes of the boxes align with the axes of the local coordinate system. Note that this uses a components.PoseRotationQuat which is also used by archetypes.InstancePoses3D.

TYPE: QuaternionArrayLike | None DEFAULT: None

colors

Optional colors for the ellipsoids.

TYPE: Rgba32ArrayLike | None DEFAULT: None

line_radii

Optional radii for the lines that make up the ellipsoids.

TYPE: Float32ArrayLike | None DEFAULT: None

fill_mode

Optionally choose whether the ellipsoids are drawn with lines or solid.

TYPE: FillMode | None DEFAULT: None

labels

Optional text labels for the ellipsoids.

TYPE: Utf8ArrayLike | None DEFAULT: None

class_ids

Optional ClassIds for the ellipsoids.

The class ID provides colors and labels if not specified explicitly.

TYPE: ClassIdArrayLike | None DEFAULT: None

class EncodedImage

Bases: EncodedImageExt, Archetype

Archetype: An image encoded as e.g. a JPEG or PNG.

Rerun also supports uncompressed images with the archetypes.Image.

To compress an image, use rerun.Image.compress.

Example
encoded_image:
from pathlib import Path

import rerun as rr

image_file_path = Path(__file__).parent / "ferris.png"

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

rr.log("image", rr.EncodedImage(path=image_file_path))
def __init__(*, path=None, contents=None, media_type=None, opacity=None, draw_order=None)

Create a new instance of the EncodedImage archetype.

PARAMETER DESCRIPTION
path

A path to an file stored on the local filesystem. Mutually exclusive with contents.

TYPE: str | Path | None DEFAULT: None

contents

The contents of the file. Can be a BufferedReader, BytesIO, or bytes. Mutually exclusive with path.

TYPE: bytes | IO[bytes] | BlobLike | None DEFAULT: None

media_type

The Media Type of the asset.

For instance: * image/jpeg * image/png

If omitted, it will be guessed from the path (if any), or the viewer will try to guess from the contents (magic header). If the media type cannot be guessed, the viewer won't be able to render the asset.

TYPE: Utf8Like | None DEFAULT: None

opacity

Opacity of the image, useful for layering several images. Defaults to 1.0 (fully opaque).

TYPE: Float32Like | None DEFAULT: None

draw_order

An optional floating point value that specifies the 2D drawing order. Objects with higher values are drawn on top of those with lower values.

TYPE: Float32Like | None DEFAULT: None

class Image

Bases: ImageExt, Archetype

Archetype: A monochrome or color image.

See also archetypes.DepthImage and archetypes.SegmentationImage.

The raw image data is stored as a single buffer of bytes in a components.Blob. The meaning of these bytes is determined by the components.ImageFormat which specifies the resolution and the pixel format (e.g. RGB, RGBA, …).

The order of dimensions in the underlying components.Blob follows the typical row-major, interleaved-pixel image format.

Rerun also supports compressed images (JPEG, PNG, …), using archetypes.EncodedImage. Compressing images can save a lot of bandwidth and memory.

Examples:

image_simple:

import numpy as np
import rerun as rr

# Create an image with numpy
image = np.zeros((200, 300, 3), dtype=np.uint8)
image[:, :, 0] = 255
image[50:150, 50:150] = (0, 255, 0)

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

rr.log("image", rr.Image(image))

Advanced usage of send_columns to send multiple images at once:

import numpy as np
import rerun as rr

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

# Timeline on which the images are distributed.
times = np.arange(0, 20)

# Create a batch of images with a moving rectangle.
width, height = 300, 200
images = np.zeros((len(times), height, width, 3), dtype=np.uint8)
images[:, :, :, 2] = 255
for t in times:
    images[t, 50:150, (t * 10) : (t * 10 + 100), 1] = 255

# Log the ImageFormat and indicator once, as static.
format_static = rr.components.ImageFormat(width=width, height=height, color_model="RGB", channel_datatype="U8")
rr.log("images", [format_static, rr.Image.indicator()], static=True)

# Send all images at once.
rr.send_columns(
    "images",
    times=[rr.TimeSequenceColumn("step", times)],
    # Reshape the images so `ImageBufferBatch` can tell that this is several blobs.
    #
    # Note that the `ImageBufferBatch` consumes arrays of bytes,
    # so if you have a different channel datatype than `U8`, you need to make sure
    # that the data is converted to arrays of bytes before passing it to `ImageBufferBatch`.
    components=[rr.components.ImageBufferBatch(images.reshape(len(times), -1))],
)

def __init__(image=None, color_model=None, *, pixel_format=None, datatype=None, bytes=None, width=None, height=None, opacity=None, draw_order=None)

Create a new image with a given format.

There are three ways to create an image: * By specifying an image as an appropriately shaped ndarray with an appropriate color_model. * By specifying bytes of an image with a pixel_format, together with width, height. * By specifying bytes of an image with a datatype and color_model, together with width, height.

PARAMETER DESCRIPTION
image

A numpy array or tensor with the image data. Leading and trailing unit-dimensions are ignored, so that 1x480x640x3x1 is treated as a 480x640x3. You also need to specify the color_model of it (e.g. "RGB").

TYPE: ImageLike | None DEFAULT: None

color_model

L, RGB, RGBA, etc, specifying how to interpret image.

TYPE: ColorModelLike | None DEFAULT: None

pixel_format

NV12, YUV420, etc. For chroma-downsampling. Requires width, height, and bytes.

TYPE: PixelFormatLike | None DEFAULT: None

datatype

The datatype of the image data. If not specified, it is inferred from the image.

TYPE: ChannelDatatypeLike | type | None DEFAULT: None

bytes

The raw bytes of an image specified by pixel_format.

TYPE: bytes | None DEFAULT: None

width

The width of the image. Only requires for pixel_format.

TYPE: int | None DEFAULT: None

height

The height of the image. Only requires for pixel_format.

TYPE: int | None DEFAULT: None

opacity

Optional opacity of the image, in 0-1. Set to 0.5 for a translucent image.

TYPE: Float32Like | None DEFAULT: None

draw_order

An optional floating point value that specifies the 2D drawing order. Objects with higher values are drawn on top of those with lower values.

TYPE: Float32Like | None DEFAULT: None

def compress(jpeg_quality=95)

Compress the given image as a JPEG.

JPEG compression works best for photographs. Only U8 RGB and grayscale images are supported, not RGBA. Note that compressing to JPEG costs a bit of CPU time, both when logging and later when viewing them.

PARAMETER DESCRIPTION
jpeg_quality

Higher quality = larger file size. A quality of 95 saves a lot of space, but is still visually very similar.

TYPE: int DEFAULT: 95

class InstancePoses3D

Bases: Archetype

Archetype: One or more transforms between the current entity and its parent. Unlike archetypes.Transform3D, it is not propagated in the transform hierarchy.

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

Currently, many visualizers support only a single instance transform per entity. Check archetype documentations for details - if not otherwise specified, only the first instance 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.

Example
Regular & instance transforms in tandem:

import numpy as np
import rerun as rr

rr.init("rerun_example_instance_pose3d_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 instance pose which affects only the box.
    rr.log("world/box", rr.InstancePoses3D(translations=[0, 0, abs(i * 0.1 - 5.0) - 5.0]))

def __init__(*, translations=None, rotation_axis_angles=None, quaternions=None, scales=None, mat3x3=None)

Create a new instance of the InstancePoses3D archetype.

PARAMETER DESCRIPTION
translations

Translation vectors.

TYPE: Vec3DArrayLike | None DEFAULT: None

rotation_axis_angles

Rotations via axis + angle.

TYPE: RotationAxisAngleArrayLike | None DEFAULT: None

quaternions

Rotations via quaternion.

TYPE: QuaternionArrayLike | None DEFAULT: None

scales

Scaling factors.

TYPE: Vec3DArrayLike | None DEFAULT: None

mat3x3

3x3 transformation matrices.

TYPE: Mat3x3ArrayLike | None DEFAULT: None

class LineStrips2D

Bases: Archetype

Archetype: 2D line strips with positions and optional colors, radii, labels, etc.

Examples:

line_strip2d_batch:

import rerun as rr
import rerun.blueprint as rrb

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

rr.log(
    "strips",
    rr.LineStrips2D(
        [
            [[0, 0], [2, 1], [4, -1], [6, 0]],
            [[0, 3], [1, 4], [2, 2], [3, 4], [4, 2], [5, 4], [6, 3]],
        ],
        colors=[[255, 0, 0], [0, 255, 0]],
        radii=[0.025, 0.005],
        labels=["one strip here", "and one strip there"],
    ),
)

# Set view bounds:
rr.send_blueprint(rrb.Spatial2DView(visual_bounds=rrb.VisualBounds2D(x_range=[-1, 7], y_range=[-3, 6])))

Lines with scene & UI radius each:
import rerun as rr

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

# A blue line with a scene unit radii of 0.01.
points = [[0, 0, 0], [0, 0, 1], [1, 0, 0], [1, 0, 1]]
rr.log(
    "scene_unit_line",
    rr.LineStrips3D(
        [points],
        # By default, radii are interpreted as world-space units.
        radii=0.01,
        colors=[0, 0, 255],
    ),
)

# A red line with a ui point radii of 5.
# UI points are independent of zooming in Views, but are sensitive to the application UI scaling.
# For 100% ui scaling, UI points are equal to pixels.
points = [[3, 0, 0], [3, 0, 1], [4, 0, 0], [4, 0, 1]]
rr.log(
    "ui_points_line",
    rr.LineStrips3D(
        [points],
        # rr.Radius.ui_points produces radii that the viewer interprets as given in ui points.
        radii=rr.Radius.ui_points(5.0),
        colors=[255, 0, 0],
    ),
)
def __init__(strips, *, radii=None, colors=None, labels=None, draw_order=None, class_ids=None)

Create a new instance of the LineStrips2D archetype.

PARAMETER DESCRIPTION
strips

All the actual 2D line strips that make up the batch.

TYPE: LineStrip2DArrayLike

radii

Optional radii for the line strips.

TYPE: Float32ArrayLike | None DEFAULT: None

colors

Optional colors for the line strips.

TYPE: Rgba32ArrayLike | None DEFAULT: None

labels

Optional text labels for the line strips.

If there's a single label present, it will be placed at the center of the entity. Otherwise, each instance will have its own label.

TYPE: Utf8ArrayLike | None DEFAULT: None

draw_order

An optional floating point value that specifies the 2D drawing order of each line strip.

Objects with higher values are drawn on top of those with lower values.

TYPE: Float32Like | None DEFAULT: None

class_ids

Optional components.ClassIds for the lines.

The components.ClassId provides colors and labels if not specified explicitly.

TYPE: ClassIdArrayLike | None DEFAULT: None

class LineStrips3D

Bases: Archetype

Archetype: 3D line strips with positions and optional colors, radii, labels, etc.

Examples:

Many strips:

import rerun as rr

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

rr.log(
    "strips",
    rr.LineStrips3D(
        [
            [
                [0, 0, 2],
                [1, 0, 2],
                [1, 1, 2],
                [0, 1, 2],
            ],
            [
                [0, 0, 0],
                [0, 0, 1],
                [1, 0, 0],
                [1, 0, 1],
                [1, 1, 0],
                [1, 1, 1],
                [0, 1, 0],
                [0, 1, 1],
            ],
        ],
        colors=[[255, 0, 0], [0, 255, 0]],
        radii=[0.025, 0.005],
        labels=["one strip here", "and one strip there"],
    ),
)

Lines with scene & UI radius each:

import rerun as rr

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

# A blue line with a scene unit radii of 0.01.
points = [[0, 0, 0], [0, 0, 1], [1, 0, 0], [1, 0, 1]]
rr.log(
    "scene_unit_line",
    rr.LineStrips3D(
        [points],
        # By default, radii are interpreted as world-space units.
        radii=0.01,
        colors=[0, 0, 255],
    ),
)

# A red line with a ui point radii of 5.
# UI points are independent of zooming in Views, but are sensitive to the application UI scaling.
# For 100% ui scaling, UI points are equal to pixels.
points = [[3, 0, 0], [3, 0, 1], [4, 0, 0], [4, 0, 1]]
rr.log(
    "ui_points_line",
    rr.LineStrips3D(
        [points],
        # rr.Radius.ui_points produces radii that the viewer interprets as given in ui points.
        radii=rr.Radius.ui_points(5.0),
        colors=[255, 0, 0],
    ),
)

def __init__(strips, *, radii=None, colors=None, labels=None, class_ids=None)

Create a new instance of the LineStrips3D archetype.

PARAMETER DESCRIPTION
strips

All the actual 3D line strips that make up the batch.

TYPE: LineStrip3DArrayLike

radii

Optional radii for the line strips.

TYPE: Float32ArrayLike | None DEFAULT: None

colors

Optional colors for the line strips.

TYPE: Rgba32ArrayLike | None DEFAULT: None

labels

Optional text labels for the line strips.

If there's a single label present, it will be placed at the center of the entity. Otherwise, each instance will have its own label.

TYPE: Utf8ArrayLike | None DEFAULT: None

class_ids

Optional components.ClassIds for the lines.

The components.ClassId provides colors and labels if not specified explicitly.

TYPE: ClassIdArrayLike | None DEFAULT: None

class Mesh3D

Bases: Mesh3DExt, Archetype

Archetype: A 3D triangle mesh as specified by its per-mesh and per-vertex properties.

See also archetypes.Asset3D.

If there are multiple archetypes.InstancePoses3D instances logged to the same entity as a mesh, an instance of the mesh will be drawn for each transform.

Examples:

Simple indexed 3D mesh:

import rerun as rr

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

rr.log(
    "triangle",
    rr.Mesh3D(
        vertex_positions=[[0.0, 1.0, 0.0], [1.0, 0.0, 0.0], [0.0, 0.0, 0.0]],
        vertex_normals=[0.0, 0.0, 1.0],
        vertex_colors=[[0, 0, 255], [0, 255, 0], [255, 0, 0]],
        triangle_indices=[2, 1, 0],
    ),
)

3D mesh with instancing:

import rerun as rr

rr.init("rerun_example_mesh3d_instancing", spawn=True)
rr.set_time_sequence("frame", 0)

rr.log(
    "shape",
    rr.Mesh3D(
        vertex_positions=[[1, 1, 1], [-1, -1, 1], [-1, 1, -1], [1, -1, -1]],
        triangle_indices=[[0, 1, 2], [0, 1, 3], [0, 2, 3], [1, 2, 3]],
        vertex_colors=[[255, 0, 0], [0, 255, 0], [0, 0, 255], [255, 255, 0]],
    ),
)
# This box will not be affected by its parent's instance poses!
rr.log(
    "shape/box",
    rr.Boxes3D(half_sizes=[[5.0, 5.0, 5.0]]),
)

for i in range(0, 100):
    rr.set_time_sequence("frame", i)
    rr.log(
        "shape",
        rr.InstancePoses3D(
            translations=[[2, 0, 0], [0, 2, 0], [0, -2, 0], [-2, 0, 0]],
            rotation_axis_angles=rr.RotationAxisAngle([0, 0, 1], rr.Angle(deg=i * 2)),
        ),
    )

def __init__(*, vertex_positions, triangle_indices=None, vertex_normals=None, vertex_colors=None, vertex_texcoords=None, albedo_texture=None, albedo_factor=None, class_ids=None)

Create a new instance of the Mesh3D archetype.

PARAMETER DESCRIPTION
vertex_positions

The positions of each vertex. If no indices are specified, then each triplet of positions is interpreted as a triangle.

TYPE: Vec3DArrayLike

triangle_indices

Optional indices for the triangles that make up the mesh.

TYPE: UVec3DArrayLike | None DEFAULT: None

vertex_normals

An optional normal for each vertex. If specified, this must have as many elements as vertex_positions.

TYPE: Vec3DArrayLike | None DEFAULT: None

vertex_texcoords

An optional texture coordinate for each vertex. If specified, this must have as many elements as vertex_positions.

TYPE: Vec2DArrayLike | None DEFAULT: None

vertex_colors

An optional color for each vertex.

TYPE: Rgba32ArrayLike | None DEFAULT: None

albedo_factor

Optional color multiplier for the whole mesh

TYPE: Rgba32Like | None DEFAULT: None

albedo_texture

Optional albedo texture. Used with vertex_texcoords on Mesh3D. Currently supports only sRGB(A) textures, ignoring alpha. (meaning that the texture must have 3 or 4 channels)

TYPE: ImageLike | None DEFAULT: None

class_ids

Optional class Ids for the vertices. The class ID provides colors and labels if not specified explicitly.

TYPE: ClassIdArrayLike | None DEFAULT: None

class Pinhole

Bases: PinholeExt, Archetype

Archetype: Camera perspective projection (a.k.a. intrinsics).

Examples:

Simple pinhole camera:

import numpy as np
import rerun as rr

rr.init("rerun_example_pinhole", spawn=True)
rng = np.random.default_rng(12345)

image = rng.uniform(0, 255, size=[3, 3, 3])
rr.log("world/image", rr.Pinhole(focal_length=3, width=3, height=3))
rr.log("world/image", rr.Image(image))

Perspective pinhole camera:

import rerun as rr

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

rr.log(
    "world/cam",
    rr.Pinhole(fov_y=0.7853982, aspect_ratio=1.7777778, camera_xyz=rr.ViewCoordinates.RUB, image_plane_distance=0.1),
)

rr.log("world/points", rr.Points3D([(0.0, 0.0, -0.5), (0.1, 0.1, -0.5), (-0.1, -0.1, -0.5)], radii=0.025))

def __init__(*, image_from_camera=None, resolution=None, camera_xyz=None, width=None, height=None, focal_length=None, principal_point=None, fov_y=None, aspect_ratio=None, image_plane_distance=None)

Create a new instance of the Pinhole archetype.

PARAMETER DESCRIPTION
image_from_camera

Row-major intrinsics matrix for projecting from camera space to image space. The first two axes are X=Right and Y=Down, respectively. Projection is done along the positive third (Z=Forward) axis. This can be specified instead of focal_length and principal_point.

TYPE: Mat3x3Like | None DEFAULT: None

resolution

Pixel resolution (usually integers) of child image space. Width and height. image_from_camera projects onto the space spanned by (0,0) and resolution - 1.

TYPE: Vec2DLike | None DEFAULT: None

camera_xyz

Sets the view coordinates for the camera.

All common values are available as constants on the components.ViewCoordinates class.

The default is ViewCoordinates.RDF, i.e. X=Right, Y=Down, Z=Forward, and this is also the recommended setting. This means that the camera frustum will point along the positive Z axis of the parent space, and the cameras "up" direction will be along the negative Y axis of the parent space.

The camera frustum will point whichever axis is set to F (or the opposite of B). When logging a depth image under this entity, this is the direction the point cloud will be projected. With RDF, the default forward is +Z.

The frustum's "up" direction will be whichever axis is set to U (or the opposite of D). This will match the negative Y direction of pixel space (all images are assumed to have xyz=RDF). With RDF, the default is up is -Y.

The frustum's "right" direction will be whichever axis is set to R (or the opposite of L). This will match the positive X direction of pixel space (all images are assumed to have xyz=RDF). With RDF, the default right is +x.

Other common formats are RUB (X=Right, Y=Up, Z=Back) and FLU (X=Forward, Y=Left, Z=Up).

NOTE: setting this to something else than RDF (the default) will change the orientation of the camera frustum, and make the pinhole matrix not match up with the coordinate system of the pinhole entity.

The pinhole matrix (the image_from_camera argument) always project along the third (Z) axis, but will be re-oriented to project along the forward axis of the camera_xyz argument.

TYPE: ViewCoordinatesLike | None DEFAULT: None

focal_length

The focal length of the camera in pixels. This is the diagonal of the projection matrix. Set one value for symmetric cameras, or two values (X=Right, Y=Down) for anamorphic cameras.

TYPE: float | ArrayLike | None DEFAULT: None

principal_point

The center of the camera in pixels. The default is half the width and height. This is the last column of the projection matrix. Expects two values along the dimensions Right and Down

TYPE: ArrayLike | None DEFAULT: None

width

Width of the image in pixels.

TYPE: int | float | None DEFAULT: None

height

Height of the image in pixels.

TYPE: int | float | None DEFAULT: None

fov_y

Vertical field of view in radians.

TYPE: float | None DEFAULT: None

aspect_ratio

Aspect ratio (width/height).

TYPE: float | None DEFAULT: None

image_plane_distance

The distance from the camera origin to the image plane when the projection is shown in a 3D viewer. This is only used for visualization purposes, and does not affect the projection itself.

TYPE: float | None DEFAULT: None

class Points2D

Bases: Points2DExt, Archetype

Archetype: A 2D point cloud with positions and optional colors, radii, labels, etc.

Examples:

Randomly distributed 2D points with varying color and radius:

import rerun as rr
import rerun.blueprint as rrb
from numpy.random import default_rng

rr.init("rerun_example_points2d_random", spawn=True)
rng = default_rng(12345)

positions = rng.uniform(-3, 3, size=[10, 2])
colors = rng.uniform(0, 255, size=[10, 4])
radii = rng.uniform(0, 1, size=[10])

rr.log("random", rr.Points2D(positions, colors=colors, radii=radii))

# Set view bounds:
rr.send_blueprint(rrb.Spatial2DView(visual_bounds=rrb.VisualBounds2D(x_range=[-4, 4], y_range=[-4, 4])))

Log points with radii given in UI points:

import rerun as rr
import rerun.blueprint as rrb

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

# Two blue points with scene unit radii of 0.1 and 0.3.
rr.log(
    "scene_units",
    rr.Points2D(
        [[0, 0], [0, 1]],
        # By default, radii are interpreted as world-space units.
        radii=[0.1, 0.3],
        colors=[0, 0, 255],
    ),
)

# Two red points with ui point radii of 40 and 60.
# UI points are independent of zooming in Views, but are sensitive to the application UI scaling.
# For 100% ui scaling, UI points are equal to pixels.
rr.log(
    "ui_points",
    rr.Points2D(
        [[1, 0], [1, 1]],
        # rr.Radius.ui_points produces radii that the viewer interprets as given in ui points.
        radii=rr.Radius.ui_points([40.0, 60.0]),
        colors=[255, 0, 0],
    ),
)

# Set view bounds:
rr.send_blueprint(rrb.Spatial2DView(visual_bounds=rrb.VisualBounds2D(x_range=[-1, 2], y_range=[-1, 2])))

def __init__(positions, *, radii=None, colors=None, labels=None, draw_order=None, class_ids=None, keypoint_ids=None)

Create a new instance of the Points2D archetype.

PARAMETER DESCRIPTION
positions

All the 2D positions at which the point cloud shows points.

TYPE: Vec2DArrayLike

radii

Optional radii for the points, effectively turning them into circles.

TYPE: Float32ArrayLike | None DEFAULT: None

colors

Optional colors for the points.

The colors are interpreted as RGB or RGBA in sRGB gamma-space, As either 0-1 floats or 0-255 integers, with separate alpha.

TYPE: Rgba32ArrayLike | None DEFAULT: None

labels

Optional text labels for the points.

TYPE: Utf8ArrayLike | None DEFAULT: None

draw_order

An optional floating point value that specifies the 2D drawing order. Objects with higher values are drawn on top of those with lower values.

TYPE: Float32ArrayLike | None DEFAULT: None

class_ids

Optional class Ids for the points.

The class ID provides colors and labels if not specified explicitly.

TYPE: ClassIdArrayLike | None DEFAULT: None

keypoint_ids

Optional keypoint IDs for the points, identifying them within a class.

If keypoint IDs are passed in but no class IDs were specified, the class ID will default to 0. This is useful to identify points within a single classification (which is identified with class_id). E.g. the classification might be 'Person' and the keypoints refer to joints on a detected skeleton.

TYPE: KeypointIdArrayLike | None DEFAULT: None

class Points3D

Bases: Points3DExt, Archetype

Archetype: A 3D point cloud with positions and optional colors, radii, labels, etc.

Examples:

Randomly distributed 3D points with varying color and radius:

import rerun as rr
from numpy.random import default_rng

rr.init("rerun_example_points3d_random", spawn=True)
rng = default_rng(12345)

positions = rng.uniform(-5, 5, size=[10, 3])
colors = rng.uniform(0, 255, size=[10, 3])
radii = rng.uniform(0, 1, size=[10])

rr.log("random", rr.Points3D(positions, colors=colors, radii=radii))

Log points with radii given in UI points:

import rerun as rr

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

# Two blue points with scene unit radii of 0.1 and 0.3.
rr.log(
    "scene_units",
    rr.Points3D(
        [[0, 1, 0], [1, 1, 1]],
        # By default, radii are interpreted as world-space units.
        radii=[0.1, 0.3],
        colors=[0, 0, 255],
    ),
)

# Two red points with ui point radii of 40 and 60.
# UI points are independent of zooming in Views, but are sensitive to the application UI scaling.
# For 100% ui scaling, UI points are equal to pixels.
rr.log(
    "ui_points",
    rr.Points3D(
        [[0, 0, 0], [1, 0, 1]],
        # rr.Radius.ui_points produces radii that the viewer interprets as given in ui points.
        radii=rr.Radius.ui_points([40.0, 60.0]),
        colors=[255, 0, 0],
    ),
)

Send several point clouds with varying point count over time in a single call:

from __future__ import annotations

import numpy as np
import rerun as rr

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

# Prepare a point cloud that evolves over time 5 timesteps, changing the number of points in the process.
times = np.arange(10, 15, 1.0)
positions = [
    [[1.0, 0.0, 1.0], [0.5, 0.5, 2.0]],
    [[1.5, -0.5, 1.5], [1.0, 1.0, 2.5], [-0.5, 1.5, 1.0], [-1.5, 0.0, 2.0]],
    [[2.0, 0.0, 2.0], [1.5, -1.5, 3.0], [0.0, -2.0, 2.5], [1.0, -1.0, 3.5]],
    [[-2.0, 0.0, 2.0], [-1.5, 1.5, 3.0], [-1.0, 1.0, 3.5]],
    [[1.0, -1.0, 1.0], [2.0, -2.0, 2.0], [3.0, -1.0, 3.0], [2.0, 0.0, 4.0]],
]
positions_arr = np.concatenate(positions)

# At each time stamp, all points in the cloud share the same but changing color.
colors = [0xFF0000FF, 0x00FF00FF, 0x0000FFFF, 0xFFFF00FF, 0x00FFFFFF]

rr.send_columns(
    "points",
    times=[rr.TimeSecondsColumn("time", times)],
    components=[
        rr.Points3D.indicator(),
        rr.components.Position3DBatch(positions_arr).partition([len(row) for row in positions]),
        rr.components.ColorBatch(colors),
    ],
)

def __init__(positions, *, radii=None, colors=None, labels=None, class_ids=None, keypoint_ids=None)

Create a new instance of the Points3D archetype.

PARAMETER DESCRIPTION
positions

All the 3D positions at which the point cloud shows points.

TYPE: Vec3DArrayLike

radii

Optional radii for the points, effectively turning them into circles.

TYPE: Float32ArrayLike | None DEFAULT: None

colors

Optional colors for the points.

The colors are interpreted as RGB or RGBA in sRGB gamma-space, As either 0-1 floats or 0-255 integers, with separate alpha.

TYPE: Rgba32ArrayLike | None DEFAULT: None

labels

Optional text labels for the points.

TYPE: Utf8ArrayLike | None DEFAULT: None

class_ids

Optional class Ids for the points.

The class ID provides colors and labels if not specified explicitly.

TYPE: ClassIdArrayLike | None DEFAULT: None

keypoint_ids

Optional keypoint IDs for the points, identifying them within a class.

If keypoint IDs are passed in but no class IDs were specified, the class ID will default to 0. This is useful to identify points within a single classification (which is identified with class_id). E.g. the classification might be 'Person' and the keypoints refer to joints on a detected skeleton.

TYPE: KeypointIdArrayLike | None DEFAULT: None

class Scalar

Bases: Archetype

Archetype: A double-precision scalar, e.g. for use for time-series plots.

The current timeline value will be used for the time/X-axis, hence scalars cannot be static.

When used to produce a plot, this archetype is used to provide the data that is referenced by archetypes.SeriesLine or archetypes.SeriesPoint. You can do this by logging both archetypes to the same path, or alternatively configuring the plot-specific archetypes through the blueprint.

Example
Simple line plot:

import math

import rerun as rr

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

# Log the data on a timeline called "step".
for step in range(0, 64):
    rr.set_time_sequence("step", step)
    rr.log("scalar", rr.Scalar(math.sin(step / 10.0)))

def __init__(scalar)

Create a new instance of the Scalar archetype.

PARAMETER DESCRIPTION
scalar

The scalar value to log.

TYPE: Float64Like

class SegmentationImage

Bases: SegmentationImageExt, Archetype

Archetype: An image made up of integer components.ClassIds.

Each pixel corresponds to a components.ClassId that will be mapped to a color based on annotation context.

In the case of floating point images, the label will be looked up based on rounding to the nearest integer value.

See also archetypes.AnnotationContext to associate each class with a color and a label.

Example
Simple segmentation image:

import numpy as np
import rerun as rr

# Create a segmentation image
image = np.zeros((8, 12), dtype=np.uint8)
image[0:4, 0:6] = 1
image[4:8, 6:12] = 2

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

# Assign a label and color to each class
rr.log("/", rr.AnnotationContext([(1, "red", (255, 0, 0)), (2, "green", (0, 255, 0))]), static=True)

rr.log("image", rr.SegmentationImage(image))

class SeriesLine

Bases: Archetype

Archetype: Define the style properties for a line series in a chart.

This archetype only provides styling information and should be logged as static when possible. The underlying data needs to be logged to the same entity-path using archetypes.Scalar.

Example
Line series:

from math import cos, sin, tau

import rerun as rr

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

# Set up plot styling:
# They are logged as static as they don't change over time and apply to all timelines.
# Log two lines series under a shared root so that they show in the same plot by default.
rr.log("trig/sin", rr.SeriesLine(color=[255, 0, 0], name="sin(0.01t)", width=2), static=True)
rr.log("trig/cos", rr.SeriesLine(color=[0, 255, 0], name="cos(0.01t)", width=4), static=True)

# Log the data on a timeline called "step".
for t in range(0, int(tau * 2 * 100.0)):
    rr.set_time_sequence("step", t)

    rr.log("trig/sin", rr.Scalar(sin(float(t) / 100.0)))
    rr.log("trig/cos", rr.Scalar(cos(float(t) / 100.0)))

def __init__(*, color=None, width=None, name=None, aggregation_policy=None)

Create a new instance of the SeriesLine archetype.

PARAMETER DESCRIPTION
color

Color for the corresponding series.

TYPE: Rgba32Like | None DEFAULT: None

width

Stroke width for the corresponding series.

TYPE: Float32Like | None DEFAULT: None

name

Display name of the series.

Used in the legend.

TYPE: Utf8Like | None DEFAULT: None

aggregation_policy

Configures the zoom-dependent scalar aggregation.

This is done only if steps on the X axis go below a single pixel, i.e. a single pixel covers more than one tick worth of data. It can greatly improve performance (and readability) in such situations as it prevents overdraw.

TYPE: AggregationPolicyLike | None DEFAULT: None

class SeriesPoint

Bases: Archetype

Archetype: Define the style properties for a point series in a chart.

This archetype only provides styling information and should be logged as static when possible. The underlying data needs to be logged to the same entity-path using archetypes.Scalar.

Example
Point series:

from math import cos, sin, tau

import rerun as rr

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

# Set up plot styling:
# They are logged as static as they don't change over time and apply to all timelines.
# Log two point series under a shared root so that they show in the same plot by default.
rr.log(
    "trig/sin",
    rr.SeriesPoint(
        color=[255, 0, 0],
        name="sin(0.01t)",
        marker="circle",
        marker_size=4,
    ),
    static=True,
)
rr.log(
    "trig/cos",
    rr.SeriesPoint(
        color=[0, 255, 0],
        name="cos(0.01t)",
        marker="cross",
        marker_size=2,
    ),
    static=True,
)

# Log the data on a timeline called "step".
for t in range(0, int(tau * 2 * 10.0)):
    rr.set_time_sequence("step", t)

    rr.log("trig/sin", rr.Scalar(sin(float(t) / 10.0)))
    rr.log("trig/cos", rr.Scalar(cos(float(t) / 10.0)))

def __init__(*, color=None, marker=None, name=None, marker_size=None)

Create a new instance of the SeriesPoint archetype.

PARAMETER DESCRIPTION
color

Color for the corresponding series.

TYPE: Rgba32Like | None DEFAULT: None

marker

What shape to use to represent the point

TYPE: MarkerShapeLike | None DEFAULT: None

name

Display name of the series.

Used in the legend.

TYPE: Utf8Like | None DEFAULT: None

marker_size

Size of the marker.

TYPE: Float32Like | None DEFAULT: None

class Tensor

Bases: TensorExt, Archetype

Archetype: An N-dimensional array of numbers.

It's not currently possible to use send_columns with tensors since construction of rerun.components.TensorDataBatch does not support more than a single element. This will be addressed as part of https://github.com/rerun-io/rerun/issues/6832.

Example
Simple tensor:

import numpy as np
import rerun as rr

tensor = np.random.randint(0, 256, (8, 6, 3, 5), dtype=np.uint8)  # 4-dimensional tensor

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

# Log the tensor, assigning names to each dimension
rr.log("tensor", rr.Tensor(tensor, dim_names=("width", "height", "channel", "batch")))

def __init__(data=None, *, dim_names=None)

Construct a Tensor archetype.

The Tensor archetype internally contains a single component: TensorData.

See the TensorData constructor for more advanced options to interpret buffers as TensorData of varying shapes.

For simple cases, you can pass array objects and optionally specify the names of the dimensions. The shape of the TensorData will be inferred from the array.

PARAMETER DESCRIPTION
self

The TensorData object to construct.

TYPE: Any

data

A TensorData object, or type that can be converted to a numpy array.

TYPE: TensorDataLike | TensorLike | None DEFAULT: None

dim_names

The names of the tensor dimensions when generating the shape from an array.

TYPE: Sequence[str | None] | None DEFAULT: None

class TextDocument

Bases: Archetype

Archetype: A text element intended to be displayed in its own text box.

Supports raw text and markdown.

Example
Markdown text document:

import rerun as rr

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

rr.log("text_document", rr.TextDocument("Hello, TextDocument!"))

rr.log(
    "markdown",
    rr.TextDocument(
        '''
# Hello Markdown!
[Click here to see the raw text](recording://markdown:Text).

Basic formatting:

| **Feature**       | **Alternative** |
| ----------------- | --------------- |
| Plain             |                 |
| *italics*         | _italics_       |
| **bold**          | __bold__        |
| ~~strikethrough~~ |                 |
| `inline code`     |                 |

----------------------------------

## Support
- [x] [Commonmark](https://commonmark.org/help/) support
- [x] GitHub-style strikethrough, tables, and checkboxes
- Basic syntax highlighting for:
  - [x] C and C++
  - [x] Python
  - [x] Rust
  - [ ] Other languages

## Links
You can link to [an entity](recording://markdown),
a [specific instance of an entity](recording://markdown[#0]),
or a [specific component](recording://markdown:Text).

Of course you can also have [normal https links](https://github.com/rerun-io/rerun), e.g. <https://rerun.io>.

## Image
![A random image](https://picsum.photos/640/480)
'''.strip(),
        media_type=rr.MediaType.MARKDOWN,
    ),
)

def __init__(text, *, media_type=None)

Create a new instance of the TextDocument archetype.

PARAMETER DESCRIPTION
text

Contents of the text document.

TYPE: Utf8Like

media_type

The Media Type of the text.

For instance: * text/plain * text/markdown

If omitted, text/plain is assumed.

TYPE: Utf8Like | None DEFAULT: None

class TextLog

Bases: Archetype

Archetype: A log entry in a text log, comprised of a text body and its log level.

Example
text_log_integration:

import logging

import rerun as rr

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

# Log a text entry directly
rr.log("logs", rr.TextLog("this entry has loglevel TRACE", level=rr.TextLogLevel.TRACE))

# Or log via a logging handler
logging.getLogger().addHandler(rr.LoggingHandler("logs/handler"))
logging.getLogger().setLevel(-1)
logging.info("This INFO log got added through the standard logging interface")

def __init__(text, *, level=None, color=None)

Create a new instance of the TextLog archetype.

PARAMETER DESCRIPTION
text

The body of the message.

TYPE: Utf8Like

level

The verbosity level of the message.

This can be used to filter the log messages in the Rerun Viewer.

TYPE: Utf8Like | None DEFAULT: None

color

Optional color to use for the log line in the Rerun Viewer.

TYPE: Rgba32Like | None DEFAULT: None

class Transform3D

Bases: Transform3DExt, Archetype

Archetype: A transform between two 3D spaces, i.e. a pose.

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.

Whenever you log this archetype, it will write all components, even if you do not explicitly set them. This means that if you first log a transform with only a translation, and then log one with only a rotation, it will be resolved to a transform with only a rotation.

Examples:

Variety of 3D transforms:

from math import pi

import rerun as rr
from rerun.datatypes import Angle, RotationAxisAngle

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

arrow = rr.Arrows3D(origins=[0, 0, 0], vectors=[0, 1, 0])

rr.log("base", arrow)

rr.log("base/translated", rr.Transform3D(translation=[1, 0, 0]))
rr.log("base/translated", arrow)

rr.log(
    "base/rotated_scaled",
    rr.Transform3D(
        rotation=RotationAxisAngle(axis=[0, 0, 1], angle=Angle(rad=pi / 4)),
        scale=2,
    ),
)
rr.log("base/rotated_scaled", arrow)

Transform hierarchy:

import numpy as np
import rerun as rr
import rerun.blueprint as rrb

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

# One space with the sun in the center, and another one with the planet.
rr.send_blueprint(
    rrb.Horizontal(rrb.Spatial3DView(origin="sun"), rrb.Spatial3DView(origin="sun/planet", contents="sun/**"))
)

rr.set_time_seconds("sim_time", 0)

# Planetary motion is typically in the XY plane.
rr.log("/", rr.ViewCoordinates.RIGHT_HAND_Z_UP, static=True)

# Setup points, all are in the center of their own space:
# TODO(#1361): Should use spheres instead of points.
rr.log("sun", rr.Points3D([0.0, 0.0, 0.0], radii=1.0, colors=[255, 200, 10]))
rr.log("sun/planet", rr.Points3D([0.0, 0.0, 0.0], radii=0.4, colors=[40, 80, 200]))
rr.log("sun/planet/moon", rr.Points3D([0.0, 0.0, 0.0], radii=0.15, colors=[180, 180, 180]))

# Draw fixed paths where the planet & moon move.
d_planet = 6.0
d_moon = 3.0
angles = np.arange(0.0, 1.01, 0.01) * np.pi * 2
circle = np.array([np.sin(angles), np.cos(angles), angles * 0.0]).transpose()
rr.log("sun/planet_path", rr.LineStrips3D(circle * d_planet))
rr.log("sun/planet/moon_path", rr.LineStrips3D(circle * d_moon))

# Movement via transforms.
for i in range(0, 6 * 120):
    time = i / 120.0
    rr.set_time_seconds("sim_time", time)
    r_moon = time * 5.0
    r_planet = time * 2.0

    rr.log(
        "sun/planet",
        rr.Transform3D(
            translation=[np.sin(r_planet) * d_planet, np.cos(r_planet) * d_planet, 0.0],
            rotation=rr.RotationAxisAngle(axis=(1, 0, 0), degrees=20),
        ),
    )
    rr.log(
        "sun/planet/moon",
        rr.Transform3D(
            translation=[np.cos(r_moon) * d_moon, np.sin(r_moon) * d_moon, 0.0],
            from_parent=True,
        ),
    )

def __init__(*, translation=None, rotation=None, rotation_axis_angle=None, quaternion=None, scale=None, mat3x3=None, from_parent=None, relation=None, axis_length=None)

Create a new instance of the Transform3D archetype.

PARAMETER DESCRIPTION
translation

3D translation vector.

TYPE: Vec3DLike | None DEFAULT: None

rotation

3D rotation, either a quaternion or an axis-angle. Mutually exclusive with quaternion and rotation_axis_angle.

TYPE: QuaternionLike | RotationAxisAngleLike | None DEFAULT: None

rotation_axis_angle

Axis-angle representing rotation.

Mutually exclusive with rotation parameter.

TYPE: RotationAxisAngleLike | None DEFAULT: None

quaternion

Quaternion representing rotation.

Mutually exclusive with rotation parameter.

TYPE: QuaternionLike | None DEFAULT: None

scale

3D scale.

TYPE: Vec3DLike | Float32Like | None DEFAULT: None

mat3x3

3x3 matrix representing scale and rotation, applied after translation. Not compatible with rotation and scale parameters. TODO(#3559): Support 4x4 and 4x3 matrices.

TYPE: Mat3x3Like | None DEFAULT: None

from_parent

If true, the transform maps from the parent space to the space where the transform was logged. Otherwise, the transform maps from the space to its parent. Deprecated in favor of relation=rerun.TransformRelation.ChildFromParent.

Mutually exclusive with relation.

TYPE: bool | None DEFAULT: None

relation

Allows to explicitly specify the transform's relationship with the parent entity. Otherwise, the transform maps from the space to its parent.

Mutually exclusive with from_parent.

TYPE: TransformRelationLike | None DEFAULT: None

axis_length

Visual length of the 3 axes.

The length is interpreted in the local coordinate system of the transform. If the transform is scaled, the axes will be scaled accordingly.

TYPE: Float32Like | None DEFAULT: None

class ViewCoordinates

Bases: ViewCoordinatesExt, Archetype

Archetype: How we interpret the coordinate system of an entity/space.

For instance: What is "up"? What does the Z axis mean? Is this right-handed or left-handed?

The three coordinates are always ordered as [x, y, z].

For example [Right, Down, Forward] means that the X axis points to the right, the Y axis points down, and the Z axis points forward.

Make sure that this archetype is logged at or above the origin entity path of your 3D views.

Example
View coordinates for adjusting the eye camera:

import rerun as rr

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

rr.log("world", rr.ViewCoordinates.RIGHT_HAND_Z_UP, static=True)  # Set an up-axis
rr.log(
    "world/xyz",
    rr.Arrows3D(
        vectors=[[1, 0, 0], [0, 1, 0], [0, 0, 1]],
        colors=[[255, 0, 0], [0, 255, 0], [0, 0, 255]],
    ),
)

def __init__(xyz)

Create a new instance of the ViewCoordinates archetype.

PARAMETER DESCRIPTION
xyz

The directions of the [x, y, z] axes.

TYPE: ViewCoordinatesLike