code wiki / _hdl_build / nx_meshpose.nx
nx_meshpose.nx
buildroot/runtime/_hdl_build/nx_meshpose.nx
about
nx_meshpose.nx -- THE POSE-MATCH INSTRUMENT (form ladder 1785935557; measured rung 2026-08-05:
the per-part table showed error growing MONOTONICALLY along each kinematic chain -- shoulder 10mm
to fingertips 357mm -- the signature of pose mismatch about the joint, not form error).
Rotates declared REGIONS of a mesh about declared PIVOTS, region and pivot and angle all DATA rows,
never code. Per-vertex selection (a boundary triangle STRETCHES rather than tears -- a crude skin).
v1 rotates about the Z axis (lateral raise in the XY plane) -- the measured need; other axes are
named rungs. Discipline: `report` measures the cluster ranges FIRST so pose rows are chosen from
measurement, not from eyeballing a render.
nx_meshpose report <in.nxmesh> <ylo_pm> <yhi_pm> -> x-cluster RANGES (per-mille) in that band
nx_meshpose apply <in.nxmesh> <out.nxmesh> <posefile> -> rotated copy (layers/colors preserved)
nx_meshpose selftest
POSE ROWS (tab-separated): rot <xlo> <xhi> <ylo> <yhi> <pivotx_pm> <pivoty_pm> <deg>
bounds+pivot in per-mille of the mesh's own bbox; deg positive = counter-clockwise in +x-right/+y-up.
license_tier: ORIGINAL expect_exit: 0
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_itrig.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 PZ_MAGIC_65536: i64 = 65536 |
| 19 | const PZ_MAGIC_4096: i64 = 4096 |
| 20 | const PZ_MAGIC_500000: i64 = 500000 |
| 21 | const PZ_MAGIC_100000: i64 = 100000 |
| 22 | const PZ_MAGIC_400000: i64 = 400000 |
| 23 | const PZ_MAGIC_98000: i64 = 98000 |
| 24 | const PZ_MAGIC_102000: i64 = 102000 |
| 25 | const PZ_MAGIC_402000: i64 = 402000 |
| 26 | const PZ_MAGIC_398000: i64 = 398000 |
| 28 | const PZ_CAP: i64 = 33554432 |
| 29 | const PZ_BINS: i64 = 128 |
| 30 | const PZ_GAP: i64 = 2 |
| 31 | const PZ_M8388607: i64 = 8388607 |
| 32 | const PZ_M8388608: i64 = 8388608 |
| 33 | const PZ_BIG: i64 = 4611686018427387903 |
| 34 | const PZ_TAB: i64 = 9 |
| 35 | const PZ_NL: i64 = 10 |
| 36 | const PZ_TWOPI: i64 = 25736 |
functions
| 38 | func hw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 39 | func pn(v: i64) -> i64 { let b: *u8=sys_mmap(32) as *u8; var x: i64=v; var ng: i64=0; if x<0{ng=1;x=0-x} var i: i64=31; if x==0{b[i]=48 as u8;i=i-1} while x>0{b[i]=(48+x%10) as u8;x=x/10;i=i-1} if ng==1{b[i]=45 as u8;i=i-1} sys_write(1,(b as i64+i+1) as *u8,31-i); return 0 } |
| 40 | func pz_u32(b: *u8, o: i64) -> i64 { return (b[o] as i64) + ((b[o+1] as i64)<<8) + ((b[o+2] as i64)<<16) + ((b[o+3] as i64)<<24) } |
| 41 | func pz_w32(b: *u8, o: i64, v: i64) -> i64 { b[o]=(v&255) as u8; b[o+1]=((v>>8)&255) as u8; b[o+2]=((v>>16)&255) as u8; b[o+3]=((v>>24)&255) as u8; return 0 } |
| 43 | func pz_f2um(w: i64) -> i64 |
| 57 | func pz_um2f(v: i64) -> i64 |
| 72 | func pz_refuse(reason: *u8) -> i64 { hw("MESHPOSE REFUSED: " as *u8); hw(reason); hw("\n" as *u8); return 0 } |
| 73 | func pz_readall(path: *u8, buf: *u8, cap: i64) -> i64 |
| 86 | func pz_argint(s: *u8) -> i64 called by 1: main |
| 99 | func pz_int(b: *u8, a: i64, e: i64) -> i64 called by 1: pz_apply |
| 112 | func pz_eol(b: *u8, n: i64, i: i64) -> i64 called by 1: pz_apply |
| 118 | func pz_cols(b: *u8, ls: i64, le: i64, col: *i64, maxc: i64) -> i64 called by 1: pz_apply |
| 135 | func pz_bbox(b: *u8, n: i64, bb: *i64) -> i64 |
| 171 | func pz_report(path: *u8, ylo: i64, yhi: i64) -> i64 |
| 239 | func pz_apply(inp: *u8, outp: *u8, posep: *u8) -> i64 |
| 323 | func st_w32(b: *u8, o: i64, v: i64) -> i64 { return pz_w32(b, o, v) } |
| 324 | func st_fix(path: *u8) -> i64 |
| 351 | func st_wr(path: *u8, s: *u8) -> i64 |
| 360 | func pz_selftest() -> i64 |
| 396 | func main(argc: i64, argv: *i64) -> i64 |