Skip to content

Make line-point containment independent of Plucker coordinate scale - #298

Open
kaushikgunasekaren wants to merge 2 commits into
rai-opensource:masterfrom
kaushikgunasekaren:fix/line-point-containment-scale
Open

kaushikgunasekaren wants to merge 2 commits into
rai-opensource:masterfrom
kaushikgunasekaren:fix/line-point-containment-scale

Conversation

@kaushikgunasekaren

Copy link
Copy Markdown

Bug

Line3.contains() compares cross(point - pp, self.w) with an absolute tolerance. Equivalent homogeneous representations of a line therefore give different answers: small direction magnitudes can accept off-line points, and large magnitudes make the distance threshold too strict.

Fix

Normalize the direction before taking the cross product in both scalar and batch paths. The residual is then the perpendicular distance, independent of a nonzero Plucker-coordinate scale. Document that tolerance interpretation.

Validation

  • 19 regression/control cases across axis-aligned and oblique directions, positive/negative scales from 1e-8 to 1e8, translated on/off-line points, scalar/batch calls and 20/40-eps geometric tolerance boundaries.
  • Before: 8 failed, 11 passed. After: all 19 pass.
  • Full local suite: 585 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.

This changes point containment only, not the line-relation predicates fixed in #232 or line-plane intersection in #291. 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