code wiki / _hdl_build / nx_selfcontact_gate.nx
nx_selfcontact_gate.nx
buildroot/runtime/_hdl_build/nx_selfcontact_gate.nx
about
nx_selfcontact_gate.nx -- TWO TISSUE SURFACES CANNOT PASS THROUGH EACH OTHER (softbody SB10).
THE ORACLE IS A MEASUREMENT, NOT THE ROUTINE'S OPINION. st_self_contact returns how many pairs it
found in contact, and grading it on its own count would be circular -- a routine that resolved
nothing and reported zero scores identically to one that worked. Every outcome tooth here is graded
on st_sc_min_sep, an INDEPENDENT all-pairs scan of the closest surface-to-surface approach.
SCOPE. Non-interpenetration only. Friction at self-contact is deliberately NOT in this rung -- see
st_self_contact's note: bundling them is the compound bar that kept the old SB3 from ever closing,
and mu is UNSET estate-wide for want of a citation, so a friction term would provably do nothing
here while making the rung look bigger than it is.
THREE RED RUNS BUILT THIS GATE, AND ALL THREE WERE ONE MISTAKE: ASKING A QUESTION ABOUT SURFACES WITH
AN INSTRUMENT THAT ANSWERS ABOUT BOXES OR AXES.
1. Placement by bounding-box overlap left the nearest surfaces 397 cmm apart -- overlapping boxes
say the bodies occupy nearby space, never that any two points of them are close. T1 caught it.
2. "Did it move" by bounding extreme read zero, because these cages meet mid-body and the particle
at max_x is nowhere near the contact.
3. "Did it move" by x displacement ALSO read zero -- correctly. sc_place leaves the cages
overlapping in x, so the nearest surfaces meet on their flanks and the contact normal is mostly
y and z. The instrument was right; the AXIS was an assumption nobody had checked.
So every tooth below is axis-free, and the displacement instrument carries a planted-shift control:
a zero from it can never again be confused with a correction that did not happen.
license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_softtissue.nxnx_gate_verdict.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
| 29 | const SC_G: i64 = 9800 |
| 30 | const SC_ITERS: i64 = 8 |
| 31 | const SC_SETTLE: i64 = 40 |
| 32 | const SC_H_MM: i64 = 10 |
| 36 | const SC_DIST_FALLBACK: i64 = 300 // only if the mesh reports no spacing at all, which is a REFUSAL case |
| 37 | const SC_PASSES: i64 = 24 // projection passes |
| 38 | const SC_FAR: i64 = 100000 // 1 m apart: the broad phase must reject this for free |
| 39 | const SC_SNAP: i64 = 4096 // >= any profile's particle count (largest measured is 1636) |
| 40 | const SC_PLANT: i64 = 7 // planted displacement for the instrument's own control, cmm |
| 44 | const SC_TOL: i64 = SC_PASSES |
functions
| 49 | func sc_translate(W: *i64, dx: i64, dy: i64, dz: i64) -> i64 |
| 63 | func sc_nsurf(W: *i64) -> i64 called by 1: main |
| 74 | func sc_snap3(W: *i64, sx: *i64, sy: *i64, sz: *i64) -> i64 called by 1: main |
| 90 | func sc_moved(W: *i64, sx: *i64, sy: *i64, sz: *i64) -> i64 called by 1: main |
| 111 | func sc_place(A: *i64, B: *i64, target: i64) -> i64 |
| 133 | func sc_settled(W: *i64) -> i64 |
| 138 | func main() -> i64 |