Point2D
Point2d
represents a singular point in two-dimensional space with optional color, radii, and label. Point2d
entities will be drawn as part of the 2D Spatial SpaceView.
It is compatible with AnnotationContext
. 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.
draw_order
can be used to control how the Point2d
entities are drawn relative to other objects within the scene. Higher values are drawn on top of lower values.
Components and APIs
Primary component: point2d
Secondary components: colorrgba
, radius
, label
, class_id
, keypoint_id
, draw_order
Python APIs: log_point, log_points
Rust API: Point2D
Simple Example
"""Log some very simple points.""" import rerun as rr rr.init("rerun_example_points2d", spawn=True) rr.log_points("simple", positions=[[0, 0], [1, 1]]) # Log an extra rect to set the view bounds rr.log_rect("bounds", [0, 0, 4, 3], rect_format=rr.RectFormat.XCYCWH)

Full Example
"""Log some random points with color and radii.""" import rerun as rr from numpy.random import default_rng rr.init("rerun_example_points2d", spawn=True) rng = default_rng(12345) positions = rng.uniform(-3, 3, size=[10, 2]) colors = rng.uniform(0, 255, size=[10, 3]) radii = rng.uniform(0, 1, size=[10]) rr.log_points("random", positions=positions, colors=colors, radii=radii) # Log an extra rect to set the view bounds rr.log_rect("bounds", [0, 0, 8, 6], rect_format=rr.RectFormat.XCYCWH)
