Skip to content

Initialize animation geometry for transformed polygon copies - #297

Open
kaushikgunasekaren wants to merge 2 commits into
rai-opensource:masterfrom
kaushikgunasekaren:fix/transformed-polygon-animation
Open

kaushikgunasekaren wants to merge 2 commits into
rai-opensource:masterfrom
kaushikgunasekaren:fix/transformed-polygon-animation

Conversation

@kaushikgunasekaren

Copy link
Copy Markdown

Bug

Polygon2.transformed() sets the copied path but not the reference path used by animate(). Plotting a transformed copy and then animating it raises AttributeError: 'Polygon2' object has no attribute 'path0'.

Fix

Use the transformed path as the copy's animation reference. Animation remains relative to that reference, including identity resets, without changing the source polygon.

Validation

  • Seven new regression cases fail before the fix and pass after it: identity/translation/rotation copies, successive frames, identity reset, source independence, patch replacement and chained transforms.
  • Full local suite: 573 passed, 3 skipped, 99 subtests passed; 29 existing warnings. Pristine baseline: 566 passed with the same skips/subtests/warnings.
  • Black 23.10.0, fatal-error flake8 checks on changed files, and git diff --check pass.
  • Rendered the transformed copy, an animation frame and an identity reset using Matplotlib Agg; inspected the output.

Independent of #296, which handles replacement style options. AI assistance was used for investigation, implementation and tests. Validated locally without robot hardware.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant