Commit cf934a8
Minor fix in test for Cylinder3
Summary:
Follow-up for D87401326. The or a problem persisted:
https://github.com/facebookresearch/ocean/actions/runs/19528205954/job/55905174755#step:7:784
Fixed a crash in CylinderT3::nearestIntersection() and TestCylinder3 when handling rays that are parallel or nearly parallel to the cylinder axis.
The quadratic equation solver EquationT<T>::solveQuadratic() has an assertion that the quadratic coefficient 'a' must be non-zero. However, when computing ray-cylinder intersections, 'a' equals [d^T·d - (d^T·q)^2], which can be approximately zero when the ray direction d is parallel to the cylinder axis q.
Added NumericT<T>::isNotEqualEps(a) checks before calling solveQuadratic() in:
1. Cylinder3.h: nearestIntersection() method
2. TestCylinder3.cpp: ground-truth calculation in test
This matches the pattern already used in TestCone3.cpp and properly handles floating-point edge cases.
Reviewed By: janherling
Differential Revision: D87572921
fbshipit-source-id: 7289e7b0354d9627d87160c8f1ab10f77e652af01 parent 0225ced commit cf934a8
2 files changed
+2
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
286 | | - | |
| 286 | + | |
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
| |||
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
320 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | | - | |
| 193 | + | |
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| |||
0 commit comments