Repository navigation
Commit feaffc3
authored
Fix the constant coefficient sign in Plane3.contains (#280)
`Plane3.contains` subtracts the constant coefficient, although planes
and their constructors use `n @ p + d = 0`. For example, `Plane3([1, 0,
0, -2]).contains([2, 0, 0])` returns false, while the point `[-2, 0, 0]`
is incorrectly accepted.
Use the same sign as the plane equation. Regression tests cover
translated planes constructed from coefficients, point/normal and three
points, positive/negative coefficient scaling, off-plane points,
tolerance, and the origin-plane case.
Validation: 10 failures before the one-line fix; all 11 new cases pass
afterward. Full suite: **484 passed, 3 skipped, 63 subtests passed**
(Windows, Python 3.12, Matplotlib Agg). Black check for the new test
file passes.
Prepared with AI assistance; reproductions and tests were executed
locally.1 parent 9d64824 commit feaffc3
2 files changed
Lines changed: 40 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | | - | |
| 193 | + | |
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
0 commit comments