diff --git a/docs/code-examples/line_strip2d_batch.py b/docs/code-examples/line_strip2d_batch.py new file mode 100644 index 000000000000..4ba74ebed287 --- /dev/null +++ b/docs/code-examples/line_strip2d_batch.py @@ -0,0 +1,14 @@ +"""Log a simple line strip.""" +import rerun as rr + +rr.init("linestrip2d", 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) diff --git a/docs/code-examples/line_strip3d_batch.py b/docs/code-examples/line_strip3d_batch.py new file mode 100644 index 000000000000..aaf39516e73d --- /dev/null +++ b/docs/code-examples/line_strip3d_batch.py @@ -0,0 +1,28 @@ +"""Log a batch of line strips.""" +import rerun as rr + +rr.init("linestrip3d", spawn=True) + +rr.log_line_strips_3d( + "batch", + [ + [ + [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]], + stroke_widths=[0.05, 0.01], +) diff --git a/docs/content/reference/data_types/linestrip2d.md b/docs/content/reference/data_types/linestrip2d.md index 0a53158cc88f..6e60a6860844 100644 --- a/docs/content/reference/data_types/linestrip2d.md +++ b/docs/content/reference/data_types/linestrip2d.md @@ -47,3 +47,15 @@ code-example: line_segments2d_simple + +## Batch Examples + +code-example: line_strip2d_batch + + + + + + + + diff --git a/docs/content/reference/data_types/linestrip3d.md b/docs/content/reference/data_types/linestrip3d.md index 6397cee3b58b..4d0115338ca9 100644 --- a/docs/content/reference/data_types/linestrip3d.md +++ b/docs/content/reference/data_types/linestrip3d.md @@ -44,3 +44,15 @@ code-example: line_segments3d_simple + +## Batch Examples + +code-example: line_strip3d_batch + + + + + + + +