Skip to content

Commit

Permalink
Add an example
Browse files Browse the repository at this point in the history
  • Loading branch information
jleibs committed Jun 6, 2024
1 parent c787dc1 commit 568ab70
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 1 deletion.
2 changes: 2 additions & 0 deletions crates/re_types/definitions/rerun/archetypes/axes3d.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ namespace rerun.archetypes;
/// \py See [`Transform3D`][rerun.archetypes.Transform3D]
/// \rs See [`Transform3D`][crate::archetypes.ScTransform3Dalar]
/// \cpp See `rerun::archetypes::Transform3D`
///
/// \example archetypes/transform3d_axes title="Transform with Axes" image="https://static.rerun.io/transform3d_axes/35cd6a68cce0cd582231984be4e2628d1627540b/1200w.png"
table Axes3D (
"attr.docs.category": "Plotting",
"attr.docs.view_types": "Spatial3D, Spatial2DView: if logged above active projection"
Expand Down
14 changes: 14 additions & 0 deletions docs/content/reference/types/archetypes/axes3d.md

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

30 changes: 30 additions & 0 deletions docs/snippets/all/archetypes/transform3d_axes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""Log different transforms."""

import rerun as rr

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

# Make the base axes longer
# Log all axes markers as static first
rr.log("base", rr.Axes3D(length=1), static=True)
rr.log("base/rotated", rr.Axes3D(length=0.5), static=True)
rr.log("base/rotated/translated", rr.Axes3D(length=0.5), static=True)

# Now sweep out a rotation relative to the base
for deg in range(360):
rr.set_time_sequence("step", deg)
rr.log(
"base/rotated",
rr.Transform3D(
rotation=rr.RotationAxisAngle(
axis=[1.0, 1.0, 1.0],
degrees=deg,
)
),
)
rr.log(
"base/rotated/translated",
rr.Transform3D(
translation=[2.0, 0, 0],
),
)
3 changes: 2 additions & 1 deletion docs/snippets/snippets.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
# You should only ever use this if the test isn't implemented and cannot yet be implemented
# for one or more specific SDKs.
[opt_out.run]
"archetypes/image_advanced" = ["cpp", "rust"] # Missing examples
"archetypes/image_advanced" = ["cpp", "rust"] # Missing examples
"archetypes/transform3d_axes" = ["cpp", "rust"] # Missing examples

"tutorials/annotation-context" = [ # Not a complete examples
"cpp",
Expand Down
1 change: 1 addition & 0 deletions rerun_py/rerun_sdk/rerun/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
Arrows2D as Arrows2D,
Arrows3D as Arrows3D,
Asset3D as Asset3D,
Axes3D as Axes3D,
BarChart as BarChart,
Boxes2D as Boxes2D,
Boxes3D as Boxes3D,
Expand Down
44 changes: 44 additions & 0 deletions rerun_py/rerun_sdk/rerun/archetypes/axes3d.py

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

0 comments on commit 568ab70

Please sign in to comment.