Commit 429e23d
authored
fix(geometry): scale SAT triangle-plane epsilon by normal magnitude (#646)
* fix(geometry): scale SAT triangle-plane epsilon by normal magnitude
Wall outer faces sitting f32-coplanar with the opening box's max-axis
face survived the void cut on Smiley-West (issue #584) because the
SAT triangle-plane separation test used a fixed `1e-6` epsilon while
its operands (`triangle_offset`, `box_projection`) both scale with
`|triangle_normal|` ~= 2 * triangle_area. For a 2.0 m x 2.6 m wall
face, |triangle_normal| ~= 5.2, so the projection-space gap from a
~3e-7 m physical offset (the f32 -> f64 round-trip slop between the
wall mesh and the f64 opening box) becomes ~1.7e-6 in projection
units -- larger than the fixed 1e-6 -- and `triangle_intersects_box`
incorrectly reported the face as separated. The clipper then skipped
those triangles and the wall stayed uncut.
Fix: multiply SAT_EPSILON by `max(|triangle_normal|, 1.0)` for the
triangle-plane test only. The box-axis tests (T1) and edge-cross
tests (T3) continue to use the fixed epsilon since they project onto
unit-length axes.
Also harden T1/T3 with the same `+/- SAT_EPSILON` slack the prior
agent added (was already in this branch's working diff) so all three
SAT separation tests remain consistent.
Repro coverage:
* `tests/production_void_path_test.rs::smiley_584_all_host_walls_have_holes`
exercises every host wall in AC-20-Smiley-West-10-Bldg.ifc through
the production `process_element_with_voids` path, builds the
`void_index` from `IfcRelVoidsElement` exactly as
`process_geometry_batch` does, and ray-casts a 3x3 grid through
each opening footprint along the wall thickness axis. Pre-fix:
4/190 walls (#49545, #50281, #61905, #87842) returned 9 hits each
-- fully solid. Post-fix: 0/190.
* `door_604_wall_55_has_a_hole` covers issue #604's regression case.
* `smiley_584_wall_0nqvcw_has_holes` covers the user-reported wall
GUID `0NQVcwUgj2fup5UuFaDTfC` with two balcony openings.
The door.ifc fixture is committed so CI can run without an external
fetch; AC-20-Smiley-West-10-Bldg.ifc is fetched on demand via
`pnpm fixtures` and the test skips if missing.
Closes #584.
* chore(wasm): rebuild artifacts with SAT triangle-plane epsilon fix
Picks up the void-cut correctness fix from the previous commit so
production gets the un-cut wall fix without waiting for a new
release. Both single-thread and threaded bundles rebuilt at -O3.1 parent 9d5f927 commit 429e23d
11 files changed
Lines changed: 3034 additions & 33 deletions
File tree
- packages
- wasm-threaded/pkg
- wasm/pkg
- rust/geometry
- src/router
- tests
- tests/fixtures/issue-604
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
607 | 607 | | |
608 | 608 | | |
609 | 609 | | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
610 | 626 | | |
611 | 627 | | |
612 | 628 | | |
| |||
1245 | 1261 | | |
1246 | 1262 | | |
1247 | 1263 | | |
| 1264 | + | |
1248 | 1265 | | |
1249 | 1266 | | |
1250 | 1267 | | |
| |||
1357 | 1374 | | |
1358 | 1375 | | |
1359 | 1376 | | |
1360 | | - | |
1361 | | - | |
1362 | | - | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
1363 | 1380 | | |
1364 | 1381 | | |
1365 | 1382 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
226 | | - | |
227 | | - | |
| 226 | + | |
| 227 | + | |
228 | 228 | | |
229 | 229 | | |
230 | | - | |
231 | | - | |
| 230 | + | |
| 231 | + | |
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
| |||
1793 | 1793 | | |
1794 | 1794 | | |
1795 | 1795 | | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
| 1801 | + | |
| 1802 | + | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
1796 | 1815 | | |
1797 | 1816 | | |
1798 | 1817 | | |
| |||
3440 | 3459 | | |
3441 | 3460 | | |
3442 | 3461 | | |
3443 | | - | |
| 3462 | + | |
3444 | 3463 | | |
3445 | 3464 | | |
3446 | 3465 | | |
| |||
3572 | 3591 | | |
3573 | 3592 | | |
3574 | 3593 | | |
| 3594 | + | |
| 3595 | + | |
| 3596 | + | |
| 3597 | + | |
| 3598 | + | |
3575 | 3599 | | |
3576 | 3600 | | |
3577 | 3601 | | |
3578 | 3602 | | |
3579 | 3603 | | |
| 3604 | + | |
| 3605 | + | |
| 3606 | + | |
| 3607 | + | |
| 3608 | + | |
3580 | 3609 | | |
3581 | 3610 | | |
3582 | 3611 | | |
3583 | 3612 | | |
3584 | 3613 | | |
3585 | | - | |
3586 | | - | |
3587 | | - | |
3588 | | - | |
3589 | | - | |
3590 | | - | |
3591 | | - | |
3592 | | - | |
3593 | | - | |
3594 | | - | |
3595 | 3614 | | |
3596 | 3615 | | |
3597 | 3616 | | |
| |||
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
116 | 117 | | |
117 | 118 | | |
118 | 119 | | |
| |||
225 | 226 | | |
226 | 227 | | |
227 | 228 | | |
228 | | - | |
229 | | - | |
230 | | - | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
231 | 232 | | |
232 | 233 | | |
233 | 234 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1799 | 1799 | | |
1800 | 1800 | | |
1801 | 1801 | | |
1802 | | - | |
| 1802 | + | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
| 1816 | + | |
1803 | 1817 | | |
1804 | 1818 | | |
1805 | 1819 | | |
| |||
1810 | 1824 | | |
1811 | 1825 | | |
1812 | 1826 | | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
1813 | 1834 | | |
1814 | 1835 | | |
1815 | 1836 | | |
| |||
1850 | 1871 | | |
1851 | 1872 | | |
1852 | 1873 | | |
1853 | | - | |
| 1874 | + | |
1854 | 1875 | | |
1855 | 1876 | | |
1856 | 1877 | | |
| |||
1871 | 1892 | | |
1872 | 1893 | | |
1873 | 1894 | | |
1874 | | - | |
| 1895 | + | |
| 1896 | + | |
| 1897 | + | |
| 1898 | + | |
| 1899 | + | |
| 1900 | + | |
| 1901 | + | |
| 1902 | + | |
| 1903 | + | |
| 1904 | + | |
| 1905 | + | |
| 1906 | + | |
| 1907 | + | |
| 1908 | + | |
| 1909 | + | |
1875 | 1910 | | |
1876 | 1911 | | |
1877 | 1912 | | |
| |||
1909 | 1944 | | |
1910 | 1945 | | |
1911 | 1946 | | |
1912 | | - | |
| 1947 | + | |
| 1948 | + | |
| 1949 | + | |
1913 | 1950 | | |
1914 | 1951 | | |
1915 | 1952 | | |
| |||
0 commit comments