LineStrips3D
3D line strips with positions and optional colors, radii, labels, etc.
Components components
Required: LineStrip3D
Shown in shown-in
- Spatial3DView
- Spatial2DView (if logged above active projection)
API reference links api-reference-links
Examples examples
Simple example simple-example
"""Log a simple line strip."""
import rerun as rr
rr.init("rerun_example_line_strip3d", spawn=True)
points = [
[0, 0, 0],
[0, 0, 1],
[1, 0, 0],
[1, 0, 1],
[1, 1, 0],
[1, 1, 1],
[0, 1, 0],
[0, 1, 1],
]
rr.log("strip", rr.LineStrips3D([points]))
Many individual segments many-individual-segments
#!/usr/bin/env python3
"""Log a simple set of line segments."""
import numpy as np
import rerun as rr
rr.init("rerun_example_line_segments3d", spawn=True)
rr.log(
"segments",
rr.LineStrips3D(
np.array(
[
[[0, 0, 0], [0, 0, 1]],
[[1, 0, 0], [1, 0, 1]],
[[1, 1, 0], [1, 1, 1]],
[[0, 1, 0], [0, 1, 1]],
],
)
),
)
Many strips many-strips
"""Log a batch of 3D line 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"],
),
)