Skip to content

Make line-plane intersection tolerance independent of coordinate scale - #291

Open
xixihaha-ha wants to merge 1 commit into
rai-opensource:masterfrom
xixihaha-ha:fix/line-plane-scale
Open

xixihaha-ha wants to merge 1 commit into
rai-opensource:masterfrom
xixihaha-ha:fix/line-plane-scale

Conversation

@xixihaha-ha

Copy link
Copy Markdown
Contributor

Line3.intersect_plane() can return None for perpendicular lines and planes after rescaling their homogeneous representations. For example:

line = Line3.PointDir([1, 2, 3], [0, 0, 1e-8])
plane = Plane3([0, 0, 1e-8, -5e-8])
line.intersect_plane(plane)  # None; intersection should be [1, 2, 5]

Scale the parallelism threshold by both direction and normal norms, so tol tests angular separation independently of their magnitudes. The intersection formula and return structure are unchanged.

Regressions cover signed rescaling, near-parallel tolerance, point/parameter consistency, and parallel lines. Five new subcases fail on unchanged 25b19b3; all eleven pass with the fix. Full suite on Windows/Python 3.11.14: 568 passed, 4 skipped, 110 subtests passed. Black 23.10.0 and git diff --check pass.

Prepared and validated with OpenAI Codex assistance.

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