nx_supports_test.nx
buildroot/runtime/nx_supports_test.nx
about
nx_supports_test.nx -- overhang detection on hand-built layer
pairs with closed-form expected counts.
Test polygons (CCW unit squares + variants):
sq1 = unit square (0,0)-(Q14,Q14)
sq_big = bigger square (-Q14,-Q14)-(2*Q14,2*Q14) -- "mushroom"
on top of unit square
sq_inside = smaller (Q14/4, Q14/4)-(3*Q14/4, 3*Q14/4) -- entirely
within sq1 (supported)
Closed-form invariants:
(a) First layer (prev=NULL): no overhang reported regardless of
cur polygon.
(b) Stacked same-size squares: 0 overhang (cur completely
inside prev expanded by any positive tolerance).
(c) Larger square on smaller: all 4 corners of cur are outside
prev's envelope -> 4 overhang points.
(d) Smaller square inside larger: 0 overhang.
(e) Bad input (cur n_verts < 3): BAD_INPUT verdict.
(f) NULL out param: BAD_INPUT verdict.
(g) Overhang tolerance 0 still works (uses prev as envelope
directly, no offset).
expect_exit: 0
license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_polygon.nxnx_supports.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 31 | const Q14: i64 = 16384 |
functions
| 33 | func main() -> i64 |