From b84de792eb32b80c193dca35ad5bb3b2438a403a Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Tue, 14 Jan 2025 18:48:42 +0100 Subject: [PATCH] update transform3d partial updates python snippet --- .../all/archetypes/transform3d_partial_updates.py | 14 +++++--------- docs/snippets/snippets.toml | 1 - 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/docs/snippets/all/archetypes/transform3d_partial_updates.py b/docs/snippets/all/archetypes/transform3d_partial_updates.py index 531f042550207..1732d476ab2dc 100644 --- a/docs/snippets/all/archetypes/transform3d_partial_updates.py +++ b/docs/snippets/all/archetypes/transform3d_partial_updates.py @@ -17,7 +17,7 @@ def truncated_radians(deg: float) -> float: rr.log( "box", rr.Boxes3D(half_sizes=[4.0, 2.0, 1.0], fill_mode=rr.components.FillMode.Solid), - rr.Transform3D(axis_length=10), + rr.Transform3D(clear=False, axis_length=10), ) for deg in range(46): @@ -25,10 +25,9 @@ def truncated_radians(deg: float) -> float: rr.set_time_sequence("step", step) rad = truncated_radians(deg * 4) - # TODO(cmc): update_fields rr.log( "box", - rr.Transform3D( + rr.Transform3D.update_fields( # TODO(cmc): we should have access to all the fields of the extended constructor too. rotation_axis_angle=rr.RotationAxisAngle(axis=[0.0, 1.0, 0.0], radians=rad), ), @@ -37,10 +36,9 @@ def truncated_radians(deg: float) -> float: for t in range(51): step += 1 rr.set_time_sequence("step", step) - # TODO(cmc): update_fields rr.log( "box", - rr.Transform3D(translation=[0, 0, t / 10.0]), + rr.Transform3D.update_fields(translation=[0, 0, t / 10.0]), ) for deg in range(46): @@ -48,10 +46,9 @@ def truncated_radians(deg: float) -> float: rr.set_time_sequence("step", step) rad = truncated_radians((deg + 45) * 4) - # TODO(cmc): update_fields rr.log( "box", - rr.Transform3D( + rr.Transform3D.update_fields( # TODO(cmc): we should have access to all the fields of the extended constructor too. rotation_axis_angle=rr.RotationAxisAngle(axis=[0.0, 1.0, 0.0], radians=rad), ), @@ -59,8 +56,7 @@ def truncated_radians(deg: float) -> float: step += 1 rr.set_time_sequence("step", step) -# TODO(cmc): update_fields(clear=True) rr.log( "box", - rr.Transform3D(axis_length=15), + rr.Transform3D.update_fields(clear=True, axis_length=15), ) diff --git a/docs/snippets/snippets.toml b/docs/snippets/snippets.toml index 35cb04b3802cf..8025753a5f5d1 100644 --- a/docs/snippets/snippets.toml +++ b/docs/snippets/snippets.toml @@ -273,7 +273,6 @@ quick_start = [ # These examples don't have exactly the same implementation. ] "archetypes/transform3d_partial_updates" = [ "cpp", # TODO(cmc): remove once C++ partial updates APIs have shipped - "py", # TODO(cmc): remove once Python partial updates APIs have shipped ] "archetypes/instance_poses3d_combined" = [ # TODO(#3235): Slight floating point differences in point grid. "cpp",