Skip to content

Commit

Permalink
update transform3d partial updates python snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
teh-cmc committed Jan 14, 2025
1 parent a653559 commit f533df7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
14 changes: 5 additions & 9 deletions docs/snippets/all/archetypes/transform3d_partial_updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,17 @@ 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):
step += 1
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),
),
Expand All @@ -37,30 +36,27 @@ 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):
step += 1
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),
),
)

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),
)
1 change: 0 additions & 1 deletion docs/snippets/snippets.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit f533df7

Please sign in to comment.