Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix point size in minimal examples #2210

Merged
merged 1 commit into from
May 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading