LineStrips2D

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

Components

Required: LineStrip2D

Recommended: Radius, Color

Optional: Text, DrawOrder, ClassId

Examples

line_strip2d_simple

"""Log a simple line strip.""" import rerun as rr rr.init("rerun_example_line_strip2d", spawn=True) rr.log( "strip", rr.LineStrips2D([[[0, 0], [2, 1], [4, -1], [6, 0]]]), ) # Log an extra rect to set the view bounds rr.log("bounds", rr.Boxes2D(centers=[3, 0], half_sizes=[4, 3]))

line_segments2d_simple

"""Log a couple 2D line segments using 2D line strips.""" import numpy as np import rerun as rr rr.init("rerun_example_line_segments2d", spawn=True) rr.log( "segments", rr.LineStrips2D(np.array([[[0, 0], [2, 1]], [[4, -1], [6, 0]]])), ) # Log an extra rect to set the view bounds rr.log("bounds", rr.Boxes2D(centers=[3, 0], half_sizes=[4, 3]))

line_strip2d_batch

"""Log a batch of 2D line strips.""" import rerun as rr 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"], ), ) # Log an extra rect to set the view bounds rr.log("bounds", rr.Boxes2D(centers=[3, 1.5], half_sizes=[4.0, 4.5]))