diff --git a/docs/snippets/all/archetypes/point3d_ui_radius.py b/docs/snippets/all/archetypes/point3d_ui_radius.py index fe91d7eaf813..ac2d736a796f 100644 --- a/docs/snippets/all/archetypes/point3d_ui_radius.py +++ b/docs/snippets/all/archetypes/point3d_ui_radius.py @@ -1,12 +1,12 @@ -"""Log some points with ui & world-space radii.""" +"""Log some points with ui points & scene unit radii.""" import rerun as rr rr.init("rerun_example_points3d_ui_radius", spawn=True) -# Two blue points with world-space radii of 0.1 and 0.3. +# Two blue points with scene unit radii of 0.1 and 0.3. rr.log( - "world_sized_points", + "scene_unit_points", rr.Points3D( [[0, 1, 0], [1, 1, 1]], # By default, radii are interpreted as world-space units. @@ -15,11 +15,11 @@ ), ) -# Two red points with ui radii of 40 and 60. -# Ui units are independent of zooming in Views, but are sensitive to the application ui scaling. -# For 100% ui scaling, ui units are equal to pixels. +# Two red points with ui point radii of 40 and 60. +# Ui points are independent of zooming in Views, but are sensitive to the application ui scaling. +# For 100% ui scaling, ui points are equal to pixels. rr.log( - "ui_sized_points", + "ui_points_points", rr.Points3D( [[0, 0, 0], [1, 0, 1]], # rr.Radius.ui_points produces radii that the viewer interprets as given in ui units. diff --git a/docs/snippets/all/archetypes/point3d_ui_radius.rs b/docs/snippets/all/archetypes/point3d_ui_radius.rs index 7cadd47401fe..88ecff6d9a8b 100644 --- a/docs/snippets/all/archetypes/point3d_ui_radius.rs +++ b/docs/snippets/all/archetypes/point3d_ui_radius.rs @@ -1,14 +1,30 @@ -//! Log some very simple points. +//! Log some points with ui points & scene unit radii. fn main() -> Result<(), Box> { let rec = rerun::RecordingStreamBuilder::new("rerun_example_points3d_ui_radius").spawn()?; + // Two blue points with scene unit radii of 0.1 and 0.3. rec.log( - "points", - &rerun::Points3D::new([(0.0, 0.0, 0.0), (1.0, 1.0, 1.0)]), - )?; + "scene_unit_points", + &rerun::Points3D::new([(0.0, 1.0, 0.0), (1.0, 1.0, 1.0)]) + // By default, radii are interpreted as world-space units. + .with_radii([0.1, 0.3]) + .with_colors([rerun::Color::from_rgb(0, 0, 255)]), + ); + + // Two red points with ui point radii of 40 and 60. + // Ui points are independent of zooming in Views, but are sensitive to the application ui scaling. + // For 100% ui scaling, ui points are equal to pixels. + rec.log( + "ui_points_points", + &rerun::Points3D::new([(0.0, 0.0, 0.0), (1.0, 0.0, 1.0)]) + // rr.Radius.ui_points produces radii that the viewer interprets as given in ui units. + .with_radii([ + rerun::Radius::new_ui_points(40.0), + rerun::Radius::new_ui_points(60.0), + ]) + .with_colors([rerun::Color::from_rgb(255, 0, 0)]), + ); Ok(()) } - -// TODO: unfinished