code wiki / _hdl_build / nx_skinwrap.nx

nx_skinwrap.nx

buildroot/runtime/_hdl_build/nx_skinwrap.nx

16921 B351 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_itoa_lib.nx nx_skinwrap.nx

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

main sw_puts sys_write sw_streq sw_selftest sw_fixture sys_mmap sw_wr32 sw_f32 sys_openat_wr sys_write ↻ sys_close sw_wrap sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close ↻ sw_puts ↻ sw_is_nxmsh2 sw_rd32 sw_r_f32 sw_depth sw_wr32 ↻ sw_f32 ↻ sys_openat_wr ↻ sys_write ↻ sys_close ↻ sw_pn nxi_out nxi_fd sys_mmap ↻ ccz_cat_num sys_write ↻ sys_munmap sw_say sys_write ↻ sw_sn

structs

none

consts

29const SW_MAGIC_8388607: i64 = 8388607
30const SW_MAGIC_8388608: i64 = 8388608
31const SW_MAGIC_3003: i64 = 3003
33const SW_HDRB: i64 = 16
34const SW_LREC: i64 = 24
35const SW_TRIB: i64 = 84
36const SW_IDXB: i64 = 4
37const SW_LENSLOT: i64 = 16
40const SW_NORM_ONE: i64 = 1000

functions

43func 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 }
called by 2: sw_wrapmain calls 1: sys_write
44func 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 }
called by 1: sw_selftest calls 1: sys_write
49func sw_pn(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: sw_wrap calls 1: nxi_out
54func sw_sn(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: sw_selftest calls 1: nxi_out
55func sw_streq(a: *u8, b: *u8) -> i64
called by 1: main
60func sw_atoi(s: *u8) -> i64
called by 1: main
66func sw_rd32(b: *u8, o: i64) -> i64
called by 2: sw_wrapsw_x_of
69func sw_wr32(b: *u8, o: i64, v: i64) -> i64
called by 2: sw_wrapsw_fixture
78func sw_r_f32(bits: i64, scale: i64) -> i64
called by 2: sw_wrapsw_x_of
92func sw_f32(v: i64, scale: i64) -> i64
called by 2: sw_wrapsw_fixture
107func sw_is_nxmsh2(b: *u8) -> i64
called by 1: sw_wrap
127func sw_depth(ypermil: i64) -> i64
called by 1: sw_wrap
139func sw_wrap(outp: *u8, bonep: *u8, dscale: i64) -> i64
216func sw_fixture(path: *u8, nt: i64) -> i64
251func sw_x_of(path: *u8, t: i64) -> i64
259func sw_selftest() -> i64
341func main(argc: i64, argv: *i64) -> i64