code wiki / _hdl_build / nx_skinwrap.nx
nx_skinwrap.nx
buildroot/runtime/_hdl_build/nx_skinwrap.nx
about
nx_skinwrap.nx -- SKIN AS AN ENVELOPE OVER BONE, offset by FORENSIC SOFT-TISSUE DEPTH.
★WHY: pipeline stage 4. This program's skin has always been emitted INDEPENDENTLY of the layers under
it, which is why brow/cheek/jaw/chin had to be modelled as parts STUCK ON an ovoid and why three tuned
chin attempts all rendered as stacked lobes. The operator named the root cause -- "you aren't building
from the inside out" -- and the fix is not another feature part: it is to DERIVE the surface from the
bone beneath. With a generated skull now sitting in the body's bone layer, that is finally possible.
★THE RULE IS MEASURED, NOT TASTED. Forensic facial reconstruction (Rhine / De Greef class) publishes the
millimetres of soft tissue over bone AT EACH LANDMARK. This codebase already owns that table -- it was
ported once into knowledge/face_tissue.dat and its first two values alone (brow at the glabella, eye
line) moved the binding number 92 -> 138 without a line of new geometry. Those depths are ABSOLUTE
physical measurements, which is exactly the kind of value that TRANSFERS between heads where a
y-position does not.
★AUDIT RAN FIRST, and it changed nothing but is why this is a new organ rather than an edit:
nx_meshthick MEASURES wall thickness by ray-casting and is built on nx_mesh3, which is capped at 4096
verts and cannot hold a 43k-triangle skull. nx_mesh_sculpt has an inflate brush that pushes verts along
their normal, but it is RADIUS-LIMITED around a brush point on a different mesh kernel. Neither does a
global, per-landmark-depth offset on NXMSH2. The "push along the normal" idiom is borrowed from
nx_mesh_sculpt deliberately, so this is consistent with the ecosystem rather than a second dialect.
nx_skinwrap <out.nxmesh> <bone.nxmesh> [depth_scale_permil]
nx_skinwrap selftest
depth_scale_permil scales the whole table (1000 = the published depths; 0 = a pure copy of the bone).
license_tier: ORIGINAL expect_exit: 0 No hw writes (Rule 26).
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_itoa_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
| 29 | const SW_MAGIC_8388607: i64 = 8388607 |
| 30 | const SW_MAGIC_8388608: i64 = 8388608 |
| 31 | const SW_MAGIC_3003: i64 = 3003 |
| 33 | const SW_HDRB: i64 = 16 |
| 34 | const SW_LREC: i64 = 24 |
| 35 | const SW_TRIB: i64 = 84 |
| 36 | const SW_IDXB: i64 = 4 |
| 37 | const SW_LENSLOT: i64 = 16 |
| 40 | const SW_NORM_ONE: i64 = 1000 |
functions
| 43 | func sw_puts(s: *u8) -> i64 { if SW_QUIET == 1 { return 0 } var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 44 | func sw_say(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 49 | func sw_pn(v: i64) -> i64 { nxi_out(v); return 0 } |
| 54 | func sw_sn(v: i64) -> i64 { nxi_out(v); return 0 } |
| 55 | func sw_streq(a: *u8, b: *u8) -> i64 called by 1: main |
| 60 | func sw_atoi(s: *u8) -> i64 called by 1: main |
| 66 | func sw_rd32(b: *u8, o: i64) -> i64 |
| 69 | func sw_wr32(b: *u8, o: i64, v: i64) -> i64 |
| 78 | func sw_r_f32(bits: i64, scale: i64) -> i64 |
| 92 | func sw_f32(v: i64, scale: i64) -> i64 |
| 107 | func sw_is_nxmsh2(b: *u8) -> i64 called by 1: sw_wrap |
| 127 | func sw_depth(ypermil: i64) -> i64 called by 1: sw_wrap |
| 139 | func sw_wrap(outp: *u8, bonep: *u8, dscale: i64) -> i64 |
| 216 | func sw_fixture(path: *u8, nt: i64) -> i64 |
| 251 | func sw_x_of(path: *u8, t: i64) -> i64 |
| 259 | func sw_selftest() -> i64 |
| 341 | func main(argc: i64, argv: *i64) -> i64 |