Skip to content

Apply replacement style options when animating polygons - #296

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

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

Conversation

@kaushikgunasekaren

Copy link
Copy Markdown

Polygon2.animate(T, **kwargs) documents that supplied style options replace the plot options. It saved them to self.args, but constructed the replacement patch from self.kwargs. For example, plotting red and animating with facecolor="blue", linewidth=4 silently kept the red, thin patch.

Store replacement options in the same self.kwargs field used by plotting and animation. Calls without new options retain the previous style, including on later frames. Replacement rather than merging follows the documented behavior. Geometry and patch removal are unchanged.

Validation: four cases covering identity, translation and rotation with replacement styles, later-frame retention, one-patch cleanup, transformed vertices, and a no-new-options control. Original code: 3 failed / 1 passed. Fixed full suite: 570 passed, 3 skipped, 99 subtests passed; 29 existing warnings. Untouched baseline: 566 passed with the same skips/subtests/warnings. Rendered and visually checked initial red, replacement blue/thick, and subsequent blue/thick frames with Agg. Python 3.10, local CPU/headless rendering, no robot hardware. Black 23.10.0, fatal-flake8 selection on changed files and git diff --check pass; whole-tree fatal-flake8 reports two existing undefined SMPose names in tests/test_dualquaternion.py, untouched here.

AI assistance was used for investigation, implementation and tests.

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