Make Line3 relation tests invariant to Plücker scale - #232
Doribelove wants to merge 2 commits into
Conversation
Normalize line directions and moments for parallel and intersection checks. Construct common perpendiculars from the nearest point and unit direction cross product, with regression coverage across Plucker scalings. Assisted-by: OpenAI Codex (GPT-6 Sol) Signed-off-by: 李永祺 <doribelove@gmail.com>
|
Thank you for the quick follow-up, and for closing out #231 so thoroughly! I independently verified this rather than just re-running your own tests: random-sampled ~10,000 scaled line pairs each for Also confirmed this merges cleanly against #224 with no conflicts, and both sets of tests pass together. Approving — nice work, thanks again. |
Keep the near-parallel tolerance test focused on direction vectors by constructing both lines through the origin. This avoids an unrelated Plucker orthogonality check failure on NumPy 2. Assisted-by: OpenAI Codex (GPT-6 Sol) Signed-off-by: 李永祺 <doribelove@gmail.com>
|
Thank you for independently validating the geometry and approving the PR. I found one test-fixture failure in the previous head's On the new head, the full suite passes locally with Python 3.10.12 / NumPy 2.2.6 (350 passed, 3 skipped) and Python 3.12.14 / NumPy 2.5.3 under This follow-up was prepared and validated with OpenAI Codex assistance on behalf of @Doribelove. |
Summary
Line3.isparallel()compared the raw cross product of Plücker direction vectors to an absolute tolerance. Scaling either representation therefore changed whether perpendicular lines were reported as parallel. The same classification feeds|,isintersecting()/^, andcommonperp().isparallel()so the threshold represents angular separation.isintersecting()so its reciprocal-product tolerance is independent of coordinate scale.commonperp()from the nearest point and the cross product of unit directions. The previous expression could also produce invalid Plücker coordinates for nonorthogonal skew lines at unit scale.For example, lines through
(0, 0, 0)along(1e-8, 0, 0)and through(0, 0, 1)along(0, 1e-8, 0)are perpendicular; before this changeisparallel()returnedTrue.This branch is based on current
masterand does not contain the separatedistance()fix in #224. I checkedclosest_to_line()on the included scaled nonparallel cases; it needs no change for this issue.Validation
pytest -q --disable-warnings: 350 passed, 3 skipped (Python 3.10).git diff --check: passed.Fixes #231.
Implementation and tests were prepared and validated with OpenAI Codex assistance.