Skip to content

Commit

Permalink
extend spatial view example, implement python extensions, fix doc links
Browse files Browse the repository at this point in the history
  • Loading branch information
Wumpf committed Dec 3, 2024
1 parent dc585e4 commit 0117aa8
Show file tree
Hide file tree
Showing 29 changed files with 151 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace rerun.archetypes;
///
/// Currently, many visualizers support only a single instance transform per entity.
/// Check archetype documentations for details - if not otherwise specified, only the first instance transform is applied.
/// Some visualizers like the mesh visualizer used for [`archetype.Mesh3D`],
/// Some visualizers like the mesh visualizer used for [archetype.Mesh3D],
/// will draw an object for every pose, a behavior also known as "instancing".
///
/// \example archetypes/instance_poses3d_combined title="Regular & instance transforms in tandem" image="https://static.rerun.io/leaf_transform3d/41674f0082d6de489f8a1cd1583f60f6b5820ddf/1200w.png"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ table Pinhole (

/// Sets the view coordinates for the camera.
///
/// All common values are available as constants on the `components.ViewCoordinates` class.
/// All common values are available as constants on the [components.ViewCoordinates] class.
///
/// The default is `ViewCoordinates::RDF`, i.e. X=Right, Y=Down, Z=Forward, and this is also the recommended setting.
/// This means that the camera frustum will point along the positive Z axis of the parent space,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ table LineGrid3D (
visible: rerun.blueprint.components.Visible ("attr.rerun.component_optional", nullable, order: 1000);

/// Space between grid lines spacing of one line to the next in scene units.
///
/// As you zoom out, successively only every tenth line is shown.
/// This controls the closest zoom level.
spacing: rerun.blueprint.components.GridSpacing ("attr.rerun.component_optional", nullable, order: 2000);

/// In what plane the grid is drawn.
///
/// Defaults to whatever plane is determined as the plane at zero units up/down as defined by [`archetype.ViewCoordinates`] if present.
/// Defaults to whatever plane is determined as the plane at zero units up/down as defined by [components.ViewCoordinates] if present.
plane: rerun.components.Plane3D ("attr.rerun.component_optional", nullable, order: 3000);

/// How thick the lines should be in ui units.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ namespace rerun.components;

/// An infinite 3D plane represented by a unit normal vector and a distance.
///
/// Any point P on the plane fulfills the equation `dot(xyz, P) - d = 0`, where `xyz` is the plane's normal and `d` the distance.
/// Any point P on the plane fulfills the equation `dot(xyz, P) - d = 0`,
/// where `xyz` is the plane's normal and `d` the distance of the plane from the origin.
/// This representation is also known as the Hesse normal form.
///
/// Note: although the normal will be passed through to the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ namespace rerun.datatypes;

/// An infinite 3D plane represented by a unit normal vector and a distance.
///
/// Any point P on the plane fulfills the equation `dot(xyz, P) - d = 0`, where `xyz` is the plane's normal and `d` the distance.
/// Any point P on the plane fulfills the equation `dot(xyz, P) - d = 0`,
/// where `xyz` is the plane's normal and `d` the distance of the plane from the origin.
/// This representation is also known as the Hesse normal form.
///
/// Note: although the normal will be passed through to the
Expand Down
2 changes: 1 addition & 1 deletion crates/store/re_types/src/archetypes/instance_poses3d.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions crates/store/re_types/src/archetypes/pinhole.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions crates/store/re_types/src/blueprint/archetypes/line_grid3d.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion crates/store/re_types/src/components/plane3d.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions crates/store/re_types/src/components/plane3d_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ impl Plane3D {
///
/// The plane will not be normalized upon creation.
#[inline]
pub fn new(normal: impl Into<crate::datatypes::Vec3D>, d: f32) -> Self {
Self(crate::datatypes::Plane3D::new(normal, d))
pub fn new(normal: impl Into<crate::datatypes::Vec3D>, distance: f32) -> Self {
Self(crate::datatypes::Plane3D::new(normal, distance))
}
}

Expand Down
3 changes: 2 additions & 1 deletion crates/store/re_types/src/datatypes/plane3d.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions crates/store/re_types/src/datatypes/plane3d_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ impl Plane3D {
///
/// The plane will not be normalized upon creation.
#[inline]
pub fn new(normal: impl Into<crate::datatypes::Vec3D>, d: f32) -> Self {
pub fn new(normal: impl Into<crate::datatypes::Vec3D>, distance: f32) -> Self {
let normal = normal.into();
Self([normal.0[0], normal.0[1], normal.0[2], d])
Self([normal.0[0], normal.0[1], normal.0[2], distance])
}
}

Expand Down
8 changes: 4 additions & 4 deletions crates/viewer/re_viewer/src/reflection/mod.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion docs/content/reference/types/components/plane3d.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion docs/content/reference/types/datatypes/plane3d.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions docs/snippets/all/views/spatial3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@
name="3D Scene",
# Set the background color to light blue.
background=[100, 149, 237],
# Configure the line grid.
line_grid=rrb.archetypes.LineGrid3D(
visible=True, # The grid is enabled by default, but you can hide it with this property.
spacing=0.1, # Makes the grid more fine-grained.
# By default, the plane is inferred from view coordinates setup, but you can set arbitrary planes.
plane=rr.components.Plane3D((0, 0, 1), -5.0),
stroke_width=2.0, # Makes the grid lines twice as thick as usual.
color=[255, 255, 255, 128], # Colors the grid a half-transparent white.
),
),
collapse_panels=True,
)
Expand Down
2 changes: 1 addition & 1 deletion rerun_cpp/src/rerun/archetypes/instance_poses3d.hpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions rerun_cpp/src/rerun/archetypes/pinhole.hpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0117aa8

Please sign in to comment.