Linestrip2D

Linestrip2D represents a series of connected line segments in two-dimensional space. The linestrip2d component is defined by a list of 2d points, which are connected sequentially. Additionally, linestrips can be drawn with color and radius. The radius controls the thickness of the line segments.

There are currently two python APIs that both use the same underlying Linestrip2D archetype.

draw_order can be used to control how the Linestrip2D entities are drawn relative to other objects within the scene. Higher values are drawn on top of lower values.

Notes:

  • There is not currently a python API for logging a batch of linestrips.
  • In the python APIs radius is currently derived from stroke_width

Components and APIs

Primary component: linestrip2d

Secondary components: colorrgba, radius, draw_order

Python APIs: log_line_strip, log_line_segments

Rust API: LineStrip2D

Simple Examples

"""Log a simple line strip.""" import rerun as rr rr.init("rerun_example_line_strip2d", spawn=True) rr.log_line_strip( "simple", [[0, 0], [2, 1], [4, -1], [6, 0]], ) # Log an extra rect to set the view bounds rr.log_rect("bounds", [3, 0, 8, 6], rect_format=rr.RectFormat.XCYCWH)
"""Log a simple set of line segments.""" import rerun as rr rr.init("rerun_example_line_segments2d", spawn=True) rr.log_line_segments( "simple", [[0, 0], [2, 1], [4, -1], [6, 0]], ) # Log an extra rect to set the view bounds rr.log_rect("bounds", [3, 0, 8, 6], rect_format=rr.RectFormat.XCYCWH)

Batch Examples

"""Log a batch of 2d line strips.""" import rerun as rr rr.init("rerun_example_line_strip2d", spawn=True) rr.log_line_strips_2d( "batch", [ [[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]], stroke_widths=[0.05, 0.01], ) # Log an extra rect to set the view bounds rr.log_rect("bounds", [3, 1.5, 8, 9], rect_format=rr.RectFormat.XCYCWH)