nx_curveskel_gate.nx
buildroot/runtime/nx_curveskel_gate.nx
about
nx_curveskel_gate.nx -- THE REFEREE FOR SKELETON-FIT: a curve skeleton extracted from a BARE mesh must SPAN the
shape's extremities, peel the right number of limbs (a linear volume = two, forking once at its thick centre;
a T = three, with a real fork joint), carry a valid single-rooted tree, reflect thickness in its root radius, be
byte-deterministic, and REFUSE a volumeless sheet by name. Linear fixtures are axis-aligned square PRISMS built
at run time under /tmp/nx_curveskel_gate (the same sealable shape nx_boneheat_gate uses, so the voxel seal is
isolated from the skeleton logic). The BRANCHED fixture is a watertight T extracted by nx_csg from the UNION of
two box SDFs (a stem and a crossbar) -- a boolean union has no internal walls, which two overlapping closed
meshes would have, and marching tetrahedra over the field is watertight by construction. Every solve is
IN-PROCESS through nx_curveskel_lib so a mutant of the lib is reached.
license_tier: ORIGINAL expect_exit: 0
dependencies 6 imports · 0 importers
imports: nx_syscalls.nxnx_gate_verdict.nxnx_nxa.nxnx_curveskel_lib.nxnx_sdf.nxnx_csg.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
| 18 | const CG_DIR: *u8 = "/tmp/nx_curveskel_gate" |
| 19 | const CG_MODE_DIR: i64 = 493 |
| 20 | const CG_AROUND: i64 = 4 |
| 21 | const CG_LEN: i64 = 6000 // 60 mm prism |
| 22 | const CG_RINGS: i64 = 61 |
| 23 | const CG_R_THIN: i64 = 300 // 3 mm half-width |
| 24 | const CG_R_FAT: i64 = 700 // 7 mm half-width |
| 25 | const CG_VERT_CAP: i64 = 2048 |
| 26 | const CG_TRI_CAP: i64 = 8192 |
| 27 | const CG_ROOT: i64 = 0 - 1 |
| 28 | const CG_SPAN_LO: i64 = 1200 // 20% of CG_LEN: a tip below this is near the z=0 end |
| 29 | const CG_SPAN_HI: i64 = 4800 // 80% of CG_LEN: a tip above this is near the z=CG_LEN end |
| 31 | const CG_MM_Q14: i64 = 16384 |
| 32 | const CG_NXA_PER_MM: i64 = 100 |
| 33 | const CG_TEE_STEM_HX: i64 = 3 // mm half-extents: stem 6 mm square, 30 mm tall |
| 34 | const CG_TEE_STEM_HZ: i64 = 15 |
| 35 | const CG_TEE_STEM_CZ: i64 = 15 |
| 36 | const CG_TEE_BAR_HX: i64 = 15 // crossbar 30 mm wide, 6 mm tall, sitting on the stem |
| 37 | const CG_TEE_BAR_HZ: i64 = 3 |
| 38 | const CG_TEE_BAR_CZ: i64 = 33 |
| 39 | const CG_TEE_LO_X: i64 = 0 - 16 |
| 40 | const CG_TEE_LO_Y: i64 = 0 - 4 |
| 41 | const CG_TEE_LO_Z: i64 = 0 - 1 |
| 42 | const CG_TEE_HI_X: i64 = 16 |
| 43 | const CG_TEE_HI_Y: i64 = 4 |
| 44 | const CG_TEE_HI_Z: i64 = 37 |
| 45 | const CG_TEE_RES: i64 = 40 // marching-tet grid: under 1 mm per cell on every axis of the 32 x 8 x 38 mm box |
| 46 | const CG_TEE_SPAN_X: i64 = 1200 // 12 mm in NXA units: a joint past this on each side has reached the crossbar tips |
| 47 | const CG_TEE_FOOT_Z: i64 = 300 // 3 mm: a joint below this has reached the stem foot |
| 48 | const CG_TEE_LIMBS: i64 = 3 |
functions
| 50 | func cg_ring_xy(k: i64, r: i64, out: *i64) -> i64 called by 1: cg_prism |
| 57 | func cg_tri(tris: *i64, st: *i64, a: i64, b: i64, c: i64) -> i64 |
| 64 | func cg_prism(vert: *i64, tris: *i64, st: *i64, r: i64, z0: i64, z1: i64, rings: i64) -> i64 |
| 110 | func cg_sheet(vert: *i64, tris: *i64, st: *i64) -> i64 |
| 121 | func cg_write(path: *u8, vert: *i64, tris: *i64, st: *i64) -> i64 |
| 132 | func cg_tee(path: *u8, out: *i64) -> i64 |
| 164 | func cg_open(path: *u8, lp: *i64) -> i64 |
| 170 | func cg_nj(b: *u8, flen: i64) -> i64 |
| 176 | func cg_joint_word(b: *u8, flen: i64, j: i64, word: i64) -> i64 |
| 181 | func cg_files_equal(pa: *u8, pb: *u8) -> i64 |
| 194 | func main() -> i64 |