nx_partloft_gate.nx
buildroot/runtime/nx_partloft_gate.nx
about
nx_partloft_gate.nx -- THE LOFTED PART (nx_partloft_lib) HELD TO KNOWN ANSWERS (procgen PG59 / anatomy AN19,
2026-09-19). A straight cylinder of known radius decomposes into the genes the source's decompose_nurbs_handles
would produce (centred skeleton, equal proportions, zero pitch, zero lateral drift, a unit-circle profile facing +x),
recomposes to its own handles within the millimetre quantisation, evaluates as a cubic B-spline whose radius is
constant around the ring and clamped to the end rows, and writes a WATERTIGHT NXMSH2 whose every directed edge has
exactly one reverse twin. A bent part built from genes survives the decompose-recompose round trip in its pitch. The
gene mutation is the identity at var = 0 (byte-identical genes), moves the radii at var = 1, keeps its pitch noise
zero-mean, and is deterministic per seed. Surface coordinates (t, yaw, rad) land where apply_attach_transform's ray
would: yaw 0 is straight down, a half turn is +y, rad 0 is the skeleton itself. NEG-CONTROLS: a cone must read as a
cone (the decomposer discriminates radii), a shape the cubic cannot carry must be refused by name, and a face size
that leaves no cap fan must be refused rather than floored. license_tier: ORIGINAL. No hw writes (Rule 26).
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_gate_verdict.nxnx_partloft_lib.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
| 16 | const PG_NU: i64 = 6 |
| 17 | const PG_NV: i64 = 8 |
| 18 | const PG_R: i64 = 200 // u10: a 20 mm radius |
| 19 | const PG_LEN: i64 = 1000 // u10: a 100 mm part along +x |
| 20 | const PG_CONE_END: i64 = 100 |
| 21 | const PG_PROP: i64 = 13107 // PL_FQ / 5 = 13107.2 |
| 22 | const PG_TOL_U10: i64 = 2 |
| 23 | const PG_TOL_PROF: i64 = 200 // Q16: the fixture octagon's own radial spread (141 for 141.42 at 45 deg) is 0.3 percent |
| 24 | const PG_TOL_BASIS: i64 = 8 |
| 25 | const PG_TOL_RING: i64 = 3 |
| 26 | const PG_TOL_PROP: i64 = 80 // Q16: a ring centre rounded to 1 u10 on a 200 u10 segment is 0.5 percent |
| 27 | const PG_RMIN_PERMIL: i64 = 850 // a periodic cubic through a regular octagon of radius R lies between 0.85 R and R |
| 28 | const PG_PERMIL: i64 = 1000 |
| 29 | const PG_FACE: i64 = 100 // u10: a 10 mm face size |
| 30 | const PG_NT_EXPECT: i64 = 220 // 11 rows x 10 ring points: 2*10*10 tube + 2*10 caps |
| 31 | const PG_SS_EXPECT: i64 = 11 |
| 32 | const PG_KU4: i64 = 21845 // PL_FQ / 3 |
| 33 | const PG_KU5: i64 = 43690 // 2 PL_FQ / 3 |
| 34 | const PG_KV3: i64 = 17873 // 3 PL_FQ / 11 |
| 35 | const PG_KV14: i64 = 83409 // PL_FQ + 3 PL_FQ / 11 |
| 36 | const PG_THETA30: i64 = 2144 // VM_PI / 6 |
| 37 | const PG_TOL_THETA: i64 = 40 // about half a degree |
| 38 | const PG_TOL_COS: i64 = 16 // Q16: the ray and its hit agree to a few milliradians |
| 39 | const PG_SEED: i64 = 7 |
| 40 | const PG_LOAD_HDR: i64 = 16 |
| 41 | const PG_EDGE_W: i64 = 6 |
| 42 | const PG_MESH: *u8 = "/tmp/nx_partloft_gate.nxmesh" |
| 43 | const PG_PART: *u8 = "/tmp/nx_partloft_gate.part" |
| 44 | const PG_ABSENT: *u8 = "/tmp/nx_partloft_gate.absent" |
functions
| 46 | func pg_abs(v: i64) -> i64 { if v < 0 { return 0 - v } return v } |
| 48 | func pg_tube(hnd: *i64, nu: i64, nv: i64, r0: i64, r1: i64, len: i64) -> i64 called by 1: main |
| 65 | func pg_max_hnd_err(a: *i64, b: *i64, n: i64) -> i64 |
| 71 | func pg_sum_absdiff(a: *i64, b: *i64, n: i64) -> i64 |
| 78 | func pg_gene_diff(a: *PlPart, b: *PlPart) -> i64 |
| 86 | func pg_near(ax: i64, ay: i64, az: i64, bx: i64, by: i64, bz: i64) -> i64 |
| 94 | func pg_watertight(path: *u8, rep: *i64) -> i64 |
| 150 | func main(argc: i64, argv: *i64) -> i64 |