Skip to content

Commit

Permalink
Fix point size in minimal examples (#2210)
Browse files Browse the repository at this point in the history
  • Loading branch information
teh-cmc authored and jleibs committed May 25, 2023
1 parent e77a1b2 commit b298258
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions examples/python/minimal/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

rr.init("minimal", spawn=True)

positions = np.vstack([xyz.ravel() for xyz in np.mgrid[3 * [slice(-5, 5, 10j)]]]).T
positions = np.vstack([xyz.ravel() for xyz in np.mgrid[3 * [slice(-10, 10, 10j)]]]).T
colors = np.vstack([rgb.ravel() for rgb in np.mgrid[3 * [slice(0, 255, 10j)]]]).astype(np.uint8).T

rr.log_points("my_points", positions=positions, colors=colors)
rr.log_points("my_points", positions=positions, colors=colors, radii=0.5)
4 changes: 2 additions & 2 deletions examples/python/minimal_options/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

rr.script_setup(args, "minimal_options")

positions = np.vstack([xyz.ravel() for xyz in np.mgrid[3 * [slice(-5, 5, 10j)]]]).T
positions = np.vstack([xyz.ravel() for xyz in np.mgrid[3 * [slice(-10, 10, 10j)]]]).T
colors = np.vstack([rgb.ravel() for rgb in np.mgrid[3 * [slice(0, 255, 10j)]]]).astype(np.uint8).T

rr.log_points("my_points", positions=positions, colors=colors)
rr.log_points("my_points", positions=positions, colors=colors, radii=0.5)

rr.script_teardown(args)
5 changes: 3 additions & 2 deletions examples/rust/minimal/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Demonstrates the most barebone usage of the Rerun SDK.
use rerun::{
components::{ColorRGBA, Point3D},
components::{ColorRGBA, Point3D, Radius},
demo_util::grid,
external::glam,
MsgSender, RecordingStreamBuilder,
Expand All @@ -10,7 +10,7 @@ use rerun::{
fn main() -> Result<(), Box<dyn std::error::Error>> {
let (rec_stream, storage) = RecordingStreamBuilder::new("minimal_rs").memory()?;

let points = grid(glam::Vec3::splat(-5.0), glam::Vec3::splat(5.0), 10)
let points = grid(glam::Vec3::splat(-10.0), glam::Vec3::splat(10.0), 10)
.map(Point3D::from)
.collect::<Vec<_>>();
let colors = grid(glam::Vec3::ZERO, glam::Vec3::splat(255.0), 10)
Expand All @@ -20,6 +20,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
MsgSender::new("my_points")
.with_component(&points)?
.with_component(&colors)?
.with_splat(Radius(0.5))?
.send(&rec_stream)?;

rec_stream.flush_blocking();
Expand Down
5 changes: 3 additions & 2 deletions examples/rust/minimal_options/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//! cargo run -p minimal_options -- --help
//! ```
use rerun::components::{ColorRGBA, Point3D};
use rerun::components::{ColorRGBA, Point3D, Radius};
use rerun::time::{TimeType, Timeline};
use rerun::{external::re_log, MsgSender, RecordingStream};

Expand All @@ -20,7 +20,7 @@ struct Args {
#[clap(long, default_value = "10")]
num_points_per_axis: usize,

#[clap(long, default_value = "5.0")]
#[clap(long, default_value = "10.0")]
radius: f32,
}

Expand All @@ -45,6 +45,7 @@ fn run(rec_stream: &RecordingStream, args: &Args) -> anyhow::Result<()> {
MsgSender::new("my_points")
.with_component(&points)?
.with_component(&colors)?
.with_splat(Radius(0.5))?
.with_time(timeline_keyframe, 0)
.send(rec_stream)?;

Expand Down

0 comments on commit b298258

Please sign in to comment.