Skip to content

Plot vertical planes without dividing by a zero normal component - #309

Open
kaushikgunasekaren wants to merge 2 commits into
rai-opensource:masterfrom
kaushikgunasekaren:fix-vertical-plane-plot-nov17
Open

kaushikgunasekaren wants to merge 2 commits into
rai-opensource:masterfrom
kaushikgunasekaren:fix-vertical-plane-plot-nov17

Conversation

@kaushikgunasekaren

Copy link
Copy Markdown

Bug

Plane3.plot() always solves for z by dividing by the z component of the normal. Vertical planes therefore produce division warnings and no finite surface. Near-vertical planes can also miss the plotting volume because the z parameterization is poorly conditioned.

Fix

Choose the coordinate with the largest absolute normal component as the dependent coordinate. Sample the other two coordinates, solve the plane equation, and clip the solved coordinate to its matching bounds. The existing axes, styling arguments and return behavior stay unchanged.

Validation

  • 21 regression/control cases cover x- and y-normal planes, an oblique vertical plane, horizontal/general/near-vertical planes, signed and small normal scales, explicit asymmetric bounds and default axes limits.
  • Assert finite surface points, the plane equation, clipping bounds and successful canvas drawing without RuntimeWarnings.
  • Before: 14 failed, 7 passed. After: all 21 pass.
  • Full local suite on Python 3.12: 587 passed, 3 skipped, 99 subtests passed; 20 warnings. Pristine master25b19b3: 566 passed, same skips/subtests, 21 warnings (the existing vertical-plane division warning is removed).
  • Black23.10.0, fatal-error flake8 and changed-file whitespace checks pass. Visually checked rendered vertical and oblique surfaces.

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