Skip to content

Return unique line intersections with cuboid edges and corners - #306

Open
kaushikgunasekaren wants to merge 2 commits into
rai-opensource:masterfrom
kaushikgunasekaren:fix-volume-unique-hits-nov15
Open

kaushikgunasekaren wants to merge 2 commits into
rai-opensource:masterfrom
kaushikgunasekaren:fix-volume-unique-hits-nov15

Conversation

@kaushikgunasekaren

Copy link
Copy Markdown

Bug

Line3.intersect_volume() adds a hit for every intersected cuboid face. A line through opposite corners returns six points, and an edge-to-edge diagonal returns four, although each has only two distinct boundary intersections.

Fix

Keep the extremal sorted scalar line parameters after collecting face hits. For a convex cuboid these are the chord endpoints. An exactly equal pair is a single tangency. No closeness tolerance is used, so short nonzero chords are retained. Document the single-point tangency case.

Validation

  • 15 regression/control cases cover corner/edge/face chords, signed direction scales from 1e-8 to 1e8, a single-point tangency, an outside line and a 2e-12-wide chord. Check point counts, coordinates and parameter reconstruction.
  • Before: 13 failed, 2 passed. After: all15 pass. An independent slab calculation agrees on500 deterministic random lines.
  • Full local suite: 581 passed, 3 skipped, 99 subtests passed; 29 baseline warnings. Pristine master25b19b3: 566 passed with the same skips/subtests/warnings.
  • Black23.10.0, fatal-error flake8 and git diff --check pass.

This changes duplicate face-hit handling, not #274's bounds input normalization. AI assistance was used for investigation, implementation and tests. Validated locally without robot hardware.

Updated intersection logic to include cases for touching the volume.
Add unit tests for Line3 volume intersection functionality.

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