From 10155959efe9aa18c1e7078936b353e0eaaa41f5 Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Fri, 22 Sep 2023 09:15:48 +0200 Subject: [PATCH 1/3] re-enable broken transform roundtrip --- docs/code-examples/roundtrips.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/code-examples/roundtrips.py b/docs/code-examples/roundtrips.py index b0923e991d10..ad03eab9e7ed 100755 --- a/docs/code-examples/roundtrips.py +++ b/docs/code-examples/roundtrips.py @@ -52,10 +52,6 @@ "point3d_random": ["cpp", "py", "rust"], # TODO(#3206): need to align everything to use PCG64 in the same order etc... don't have time for that. "tensor_one_dim": ["cpp", "py", "rust"], # TODO(#3206): need to align everything to use PCG64 in the same order etc... don't have time for that. "tensor_simple": ["cpp", "py", "rust"], # TODO(#3206): need to align everything to use PCG64 in the same order etc... don't have time for that. - # TODO(#3207): two issues: - # - cpp sends an identity transform for no reason - # - python has a crazy indicator component out of nowhere - "transform3d_simple": ["cpp", "py", "rust"], } # fmt: on From 38be5cc03d554a988cb61c3f8caf89f9c3f3f3c6 Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Fri, 22 Sep 2023 09:41:51 +0200 Subject: [PATCH 2/3] fix transform3d_simple examples --- docs/code-examples/transform3d_simple.py | 13 ++++--------- docs/code-examples/transform3d_simple.rs | 4 ++-- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/docs/code-examples/transform3d_simple.py b/docs/code-examples/transform3d_simple.py index ee7ee0cfa45e..f4cc8b71df76 100644 --- a/docs/code-examples/transform3d_simple.py +++ b/docs/code-examples/transform3d_simple.py @@ -7,14 +7,10 @@ rr.init("rerun_example_transform3d", spawn=True) -origin = [0, 0, 0] -base_vector = [0, 1, 0] +rr2.log("base", rr2.Arrows3D([0, 1, 0])) -rr.log_arrow("base", origin=origin, vector=base_vector) - -rr2.log("base/translated", rrd.TranslationRotationScale3D(translation=[1, 0, 0])) - -rr.log_arrow("base/translated", origin=origin, vector=base_vector) +rr2.log("base/translated", rrd.TranslationAndMat3x3(translation=[1, 0, 0])) +rr2.log("base/translated", rr2.Arrows3D([0, 1, 0])) rr2.log( "base/rotated_scaled", @@ -23,5 +19,4 @@ scale=2, ), ) - -rr.log_arrow("base/rotated_scaled", origin=origin, vector=base_vector) +rr2.log("base/rotated_scaled", rr2.Arrows3D([0, 1, 0])) diff --git a/docs/code-examples/transform3d_simple.rs b/docs/code-examples/transform3d_simple.rs index b39cd9cc4e4d..b034ee0feb3b 100644 --- a/docs/code-examples/transform3d_simple.rs +++ b/docs/code-examples/transform3d_simple.rs @@ -3,7 +3,7 @@ use rerun::{ archetypes::{Arrows3D, Transform3D}, datatypes::{ - Angle, Mat3x3, RotationAxisAngle, Scale3D, TranslationAndMat3x3, TranslationRotationScale3D, + Angle, RotationAxisAngle, Scale3D, TranslationAndMat3x3, TranslationRotationScale3D, }, RecordingStreamBuilder, }; @@ -16,7 +16,7 @@ fn main() -> Result<(), Box> { rec.log( "base/translated", - &Transform3D::new(TranslationAndMat3x3::new([1.0, 0.0, 0.0], Mat3x3::IDENTITY)), + &Transform3D::new(TranslationAndMat3x3::translation([1.0, 0.0, 0.0])), )?; rec.log("base/translated", &Arrows3D::new([(0.0, 1.0, 0.0)]))?; From eddb08fa102356e42e815da2c006cf658b3ef7ca Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Fri, 22 Sep 2023 09:41:59 +0200 Subject: [PATCH 3/3] codegen --- crates/re_types/source_hash.txt | 2 +- crates/re_types/src/archetypes/transform3d.rs | 4 ++-- rerun_py/rerun_sdk/rerun/archetypes/transform3d.py | 13 ++++--------- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/crates/re_types/source_hash.txt b/crates/re_types/source_hash.txt index a19b131417a0..d4bcb2884b55 100644 --- a/crates/re_types/source_hash.txt +++ b/crates/re_types/source_hash.txt @@ -1,4 +1,4 @@ # This is a sha256 hash for all direct and indirect dependencies of this crate's build script. # It can be safely removed at anytime to force the build script to run again. # Check out build.rs to see how it's computed. -c1035773b907fbad5b925f086e0822586bb0c3e75a86465d955623de9f7c3ad3 +6f8f25bbe0900f90a47718d6993eaf116ba1e7ac8b59762162bbfe633b5a7e50 diff --git a/crates/re_types/src/archetypes/transform3d.rs b/crates/re_types/src/archetypes/transform3d.rs index 95c0138f3e21..fa5c1caef294 100644 --- a/crates/re_types/src/archetypes/transform3d.rs +++ b/crates/re_types/src/archetypes/transform3d.rs @@ -23,7 +23,7 @@ /// use rerun::{ /// archetypes::{Arrows3D, Transform3D}, /// datatypes::{ -/// Angle, Mat3x3, RotationAxisAngle, Scale3D, TranslationAndMat3x3, TranslationRotationScale3D, +/// Angle, RotationAxisAngle, Scale3D, TranslationAndMat3x3, TranslationRotationScale3D, /// }, /// RecordingStreamBuilder, /// }; @@ -36,7 +36,7 @@ /// /// rec.log( /// "base/translated", -/// &Transform3D::new(TranslationAndMat3x3::new([1.0, 0.0, 0.0], Mat3x3::IDENTITY)), +/// &Transform3D::new(TranslationAndMat3x3::translation([1.0, 0.0, 0.0])), /// )?; /// /// rec.log("base/translated", &Arrows3D::new([(0.0, 1.0, 0.0)]))?; diff --git a/rerun_py/rerun_sdk/rerun/archetypes/transform3d.py b/rerun_py/rerun_sdk/rerun/archetypes/transform3d.py index d98e772c2254..1cf437c98088 100644 --- a/rerun_py/rerun_sdk/rerun/archetypes/transform3d.py +++ b/rerun_py/rerun_sdk/rerun/archetypes/transform3d.py @@ -31,14 +31,10 @@ class Transform3D(Archetype): rr.init("rerun_example_transform3d", spawn=True) - origin = [0, 0, 0] - base_vector = [0, 1, 0] + rr2.log("base", rr2.Arrows3D([0, 1, 0])) - rr.log_arrow("base", origin=origin, vector=base_vector) - - rr2.log("base/translated", rrd.TranslationRotationScale3D(translation=[1, 0, 0])) - - rr.log_arrow("base/translated", origin=origin, vector=base_vector) + rr2.log("base/translated", rrd.TranslationAndMat3x3(translation=[1, 0, 0])) + rr2.log("base/translated", rr2.Arrows3D([0, 1, 0])) rr2.log( "base/rotated_scaled", @@ -47,8 +43,7 @@ class Transform3D(Archetype): scale=2, ), ) - - rr.log_arrow("base/rotated_scaled", origin=origin, vector=base_vector) + rr2.log("base/rotated_scaled", rr2.Arrows3D([0, 1, 0])) ``` """