diff --git a/docs/code-examples/arrow3d_simple.py b/docs/code-examples/arrow3d_simple.py new file mode 100644 index 000000000000..a63beadf16c2 --- /dev/null +++ b/docs/code-examples/arrow3d_simple.py @@ -0,0 +1,6 @@ +"""Log a single arrow.""" +import rerun as rr + +rr.init("arrow", spawn=True) + +rr.log_arrow("simple", origin=[0, 0, 0], vector=[1, 0, 1], width_scale=0.05) diff --git a/docs/code-examples/box3d_simple.py b/docs/code-examples/box3d_simple.py new file mode 100644 index 000000000000..5bdabea282f3 --- /dev/null +++ b/docs/code-examples/box3d_simple.py @@ -0,0 +1,6 @@ +"""Log a single oriented bounding box.""" +import rerun as rr + +rr.init("box3d", spawn=True) + +rr.log_obb("simple", half_size=[2.0, 2.0, 1.0]) diff --git a/docs/code-examples/line_segments2d_simple.py b/docs/code-examples/line_segments2d_simple.py new file mode 100644 index 000000000000..49112a3d88b2 --- /dev/null +++ b/docs/code-examples/line_segments2d_simple.py @@ -0,0 +1,12 @@ +"""Log a simple set of line segments.""" +import rerun as rr + +rr.init("linesegments2d", 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) diff --git a/docs/code-examples/line_segments3d_simple.py b/docs/code-examples/line_segments3d_simple.py new file mode 100644 index 000000000000..cfc26ad3f0bd --- /dev/null +++ b/docs/code-examples/line_segments3d_simple.py @@ -0,0 +1,18 @@ +"""Log a simple set of line segments.""" +import rerun as rr + +rr.init("linesegments3d", spawn=True) + +rr.log_line_segments( + "simple", + [ + [0, 0, 0], + [0, 0, 1], + [1, 0, 0], + [1, 0, 1], + [1, 1, 0], + [1, 1, 1], + [0, 1, 0], + [0, 1, 1], + ], +) diff --git a/docs/code-examples/line_strip2d_simple.py b/docs/code-examples/line_strip2d_simple.py new file mode 100644 index 000000000000..b69797594805 --- /dev/null +++ b/docs/code-examples/line_strip2d_simple.py @@ -0,0 +1,12 @@ +"""Log a simple line strip.""" +import rerun as rr + +rr.init("linestrip2d", 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) diff --git a/docs/code-examples/line_strip3d_simple.py b/docs/code-examples/line_strip3d_simple.py new file mode 100644 index 000000000000..e5e5c5806a60 --- /dev/null +++ b/docs/code-examples/line_strip3d_simple.py @@ -0,0 +1,18 @@ +"""Log a simple line strip.""" +import rerun as rr + +rr.init("linestrip3d", spawn=True) + +rr.log_line_strip( + "simple", + [ + [0, 0, 0], + [0, 0, 1], + [1, 0, 0], + [1, 0, 1], + [1, 1, 0], + [1, 1, 1], + [0, 1, 0], + [0, 1, 1], + ], +) diff --git a/docs/code-examples/mesh_simple.py b/docs/code-examples/mesh_simple.py new file mode 100644 index 000000000000..67392d107698 --- /dev/null +++ b/docs/code-examples/mesh_simple.py @@ -0,0 +1,24 @@ +"""Log a simple colored triangle.""" +import rerun as rr + +rr.init("mesh", spawn=True) + +rr.log_mesh( + "triangle", + positions=[ + [0.0, 0.0, 0.0], + [1.0, 0.0, 0.0], + [0.0, 1.0, 0.0], + ], + indices=[0, 1, 2], + normals=[ + [0.0, 0.0, 1.0], + [0.0, 0.0, 1.0], + [0.0, 0.0, 1.0], + ], + vertex_colors=[ + [255, 0, 0], + [0, 255, 0], + [0, 0, 255], + ], +) diff --git a/docs/code-examples/rect2d_simple.py b/docs/code-examples/rect2d_simple.py new file mode 100644 index 000000000000..d927e067fd15 --- /dev/null +++ b/docs/code-examples/rect2d_simple.py @@ -0,0 +1,9 @@ +"""Log a simple rectangle.""" +import rerun as rr + +rr.init("rect2d", spawn=True) + +rr.log_rect("simple", [-1, -1, 2, 2], rect_format=rr.RectFormat.XYWH) + +# Log an extra rect to set the view bounds +rr.log_rect("bounds", [0, 0, 4, 3], rect_format=rr.RectFormat.XCYCWH) diff --git a/docs/content/reference/data_types/arrow3d.md b/docs/content/reference/data_types/arrow3d.md index 8f08bee16141..570f3c3c22bb 100644 --- a/docs/content/reference/data_types/arrow3d.md +++ b/docs/content/reference/data_types/arrow3d.md @@ -2,6 +2,14 @@ title: Arrow3D order: 1 --- +`Arrow3D` represents a singular arrow in three-dimensional space. The `arrow3d` component is defined by an origin, and a +vector relative to that origin. The arrow tip will be drawn at the end of the vector, pointing away from the origin. +Additionally, arrows can be drawn with color, radius, and labels. The radius controls the thickness of the arrow. + +Notes: +* In the python APIs `radius` is currently derived from `width_scale` +* [Arrow APIs do not currently support batching](https://github.com/rerun-io/rerun/issues/2466) + ## Components and APIs Primary component: `arrow3d` @@ -10,3 +18,15 @@ Secondary components: `colorrgba`, `radius`, `label` Python APIs: [log_arrow](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_arrow) Rust API: [Arrow3D](https://docs.rs/rerun/latest/rerun/components/struct.Arrow3D.html) + +## Simple Example + +code-example: arrow3d_simple + + + + + + + + diff --git a/docs/content/reference/data_types/box3d.md b/docs/content/reference/data_types/box3d.md index bd1f8319cd8a..c0254eee9978 100644 --- a/docs/content/reference/data_types/box3d.md +++ b/docs/content/reference/data_types/box3d.md @@ -2,6 +2,14 @@ title: Box3D order: 3 --- +`Box3D` represents an oriented bounding box in three-dimensional space. The `box3d` component is defined by the +half-widths of the three box dimensions. By default the box will be centered at the origin and aligned with the axes. +The box can be positioned within it's local [space](../../concepts/spaces-and-transforms.md) by providing the `vec3d` position, or a `quaternion` orientation. + +It is compatible with [`AnnotationContext`](../../concepts/annotation-context.md). `class_id` can be used to provide +colors and labels from the annotation context. See examples in the +[`AnnotationContext`](../../concepts/annotation-context.md) documentation. + ## Components and APIs Primary component: `box3d`, @@ -10,3 +18,15 @@ Secondary components: `vec3d`, `quaternion`, `colorrgba`, `radius`, `label`, `cl Python APIs: [log_obb](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_obb) Rust API: [Box3D](https://docs.rs/rerun/latest/rerun/components/struct.Box3D.html) + +## Simple Example + +code-example: box3d_simple + + + + + + + + diff --git a/docs/content/reference/data_types/linestrip2d.md b/docs/content/reference/data_types/linestrip2d.md index db1f769f8f28..94aa8ceb891c 100644 --- a/docs/content/reference/data_types/linestrip2d.md +++ b/docs/content/reference/data_types/linestrip2d.md @@ -2,6 +2,20 @@ title: Linestrip2D order: 4 --- +`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. + * [log_line_strip](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_line_strip) outputs a single linestrip from the provided points. + * [log_line_segments](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_line_segments) outputs a batch of linestrips each made up of a single line. + +`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` @@ -11,3 +25,25 @@ Secondary components: `colorrgba`, `radius`, `draw_order` Python APIs: [log_line_strip](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_line_strip), [log_line_segments](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_line_segments) Rust API: [LineStrip2D](https://docs.rs/rerun/latest/rerun/components/struct.LineStrip2D.html) + +## Simple Examples + +code-example: line_strip2d_simple + + + + + + + + + +code-example: line_segments2d_simple + + + + + + + + diff --git a/docs/content/reference/data_types/linestrip3d.md b/docs/content/reference/data_types/linestrip3d.md index 84c0382d6052..e831f7001a90 100644 --- a/docs/content/reference/data_types/linestrip3d.md +++ b/docs/content/reference/data_types/linestrip3d.md @@ -2,6 +2,18 @@ title: Linestrip3D order: 5 --- +`Linestrip3D` represents a series of connected line segments in three-dimensional space. The `linestrip3d` component is +defined by a list of 3d 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 `Linestrip3D` archetype. + * [log_line_strip](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_line_strip) outputs a single linestrip from the provided points. + * [log_line_segments](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_line_segments) outputs a batch of linestrips each made up of a single line. + +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: `linestrip3d` @@ -10,3 +22,25 @@ Secondary components: `colorrgba`, `radius` Python APIs: [log_line_strip](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_line_strip), [log_line_segments](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_line_segments) Rust API: [LineStrip3D](https://docs.rs/rerun/latest/rerun/components/struct.LineStrip3D.html) + +## Simple Examples + +code-example: line_strip3d_simple + + + + + + + + + +code-example: line_segments3d_simple + + + + + + + + diff --git a/docs/content/reference/data_types/mesh.md b/docs/content/reference/data_types/mesh.md index e54881a56551..35b08cb5f8a0 100644 --- a/docs/content/reference/data_types/mesh.md +++ b/docs/content/reference/data_types/mesh.md @@ -2,6 +2,9 @@ title: Mesh order: 6 --- +`Mesh` represents a 3D mesh. It is defined by specifying its vertex positions, and optionally indices, normals, +albedo factor, and vertex-colors. `Mesh` entities will be drawn as part of the 3D Spatial SpaceView. + ## Components and APIs Primary component: `mesh3d` @@ -10,3 +13,15 @@ Secondary components: `colorrgba` Python APIs: [log_mesh](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_mesh), [log_meshes](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_meshes), [log_mesh_file](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_mesh_file) Rust API: [Mesh3D](https://docs.rs/rerun/latest/rerun/components/enum.Mesh3D.html) + +## Simple Examples + +code-example: mesh_simple + + + + + + + + diff --git a/docs/content/reference/data_types/point3d.md b/docs/content/reference/data_types/point3d.md index 6f9dde95005f..7f77b8e570cb 100644 --- a/docs/content/reference/data_types/point3d.md +++ b/docs/content/reference/data_types/point3d.md @@ -2,6 +2,12 @@ title: Point3D order: 8 --- +`Point3D` represents a singular point in three-dimensional space with optional color, radii, and label. `Point3D` entities will be drawn as part of the 3D Spatial SpaceView. + +It is compatible with [`AnnotationContext`](../../concepts/annotation-context.md). `class_id` can be used to provide +colors and labels from the annotation context, and `keypoint_id` can be used to make connected edges between points. See +examples in the `AnnotationContext` documentation. + ## Components and APIs Primary component: `point3d` @@ -11,8 +17,25 @@ Python APIs: [log_point](https://ref.rerun.io/docs/python/latest/common/spatial_ Rust API: [Point3D](https://docs.rs/rerun/latest/rerun/components/struct.Point3D.html) -### Simple Example +## Simple Example code-example: point3d_simple -### Complex Example + + + + + + + + +## Full Example + code-example: point3d_random + + + + + + + + diff --git a/docs/content/reference/data_types/rect2d.md b/docs/content/reference/data_types/rect2d.md index f32a34bb12c0..813e06030419 100644 --- a/docs/content/reference/data_types/rect2d.md +++ b/docs/content/reference/data_types/rect2d.md @@ -2,6 +2,22 @@ title: Rect2D order: 2 --- +`Rect2D` represents a rectangle in two-dimensional space. The `rect2d` component is always defined by a 4-element list, +with one of several representations: +* XYWH = `[x, y, w, h]`, with x,y = left,top. +* YXHW = `[y, x, h, w]`, with x,y = left,top. +* XYXY = `[x0, y0, x1, y1]`, with x0,y0 = left,top and x1,y1 = right,bottom +* YXYX = `[y0, x0, y1, x1]`, with x0,y0 = left,top and x1,y1 = right,bottom +* XCYCWH = `[x_center, y_center, width, height]` +* XCYCW2H2 = `[x_center, y_center, width/2, height/2]` + + +It is compatible with [`AnnotationContext`](../../concepts/annotation-context.md). `class_id` can be used to provide +colors and labels from the annotation context. See examples in the +[`AnnotationContext`](../../concepts/annotation-context.md) documentation. + +`draw_order` can be used to control how the `Rect2D` entities are drawn relative to other objects within the scene. Higher values are drawn on top of lower values. + ## Components and APIs Primary component: `rect2d`, @@ -10,3 +26,15 @@ Secondary components: `colorrgba`, `radius`, `label`, `classid`, `draw_order` Python APIs: [log_rect](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_rect), [log_rects](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_rects) Rust API: [Rect2D](https://docs.rs/rerun/latest/rerun/components/enum.Rect2D.html) + +## Simple Example + +code-example: rect2d_simple + + + + + + + + diff --git a/docs/cspell.json b/docs/cspell.json index 4f3e462ef745..81618dbd94db 100644 --- a/docs/cspell.json +++ b/docs/cspell.json @@ -57,7 +57,13 @@ "xyzw", "jleibs", "Trimesh", - "srcset" + "srcset", + "XYWH", + "YXHW", + "XYXY", + "YXYX", + "XCYCWH", + "XCYCW2H2" ], "words": [ "nyud", @@ -78,6 +84,7 @@ "keypoints", "lerp", "linestrip", + "linestrips", "linspace", "loggable", "meshgrid",