code wiki / _hdl_build / nx_flexbody.nx
nx_flexbody.nx
buildroot/runtime/_hdl_build/nx_flexbody.nx
about
nx_flexbody.nx -- THE INTEGRATION: the four pipeline laws, wired onto an actual emitted body.
Each stage of the inside-out pipeline now exists as a proven, gated organ -- generated bones with joint
constraints, volume-preserving muscle, layer-aware fascia, and skin as an envelope. But proven organs are
not a body. Until the laws drive the emitted mesh, the architecture is complete and the FIGURE is
unchanged, and a render is the only thing that can tell those two states apart.
This organ closes that loop for the muscle->skin half. Given a joint flex angle it applies, to a real
layered mesh, in a chosen band of the figure:
* nx_myo's law -- radius = r0*sqrt(L0/L), so the muscle THICKENS by exactly what volume conservation
demands at that flex. The bulge factor is computed, never dialled.
* nx_derm's law -- the skin rides ON the muscle, so it is displaced by the SAME radial factor and the
envelope invariant holds by construction: skin cannot sink beneath what it covers.
* the layer rule -- BONE DOES NOT MOVE. Verified in the output, not assumed.
Displacement is RADIAL about the figure's own vertical axis, which is what a limb girth change actually
is; a purely vertical displacement would slide tissue along the bone instead of swelling around it.
nx_flexbody <in.nxmesh> <out.nxmesh> <flex_deg> [band_lo_permil] [band_hi_permil]
nx_flexbody selftest
license_tier: ORIGINAL expect_exit: 0 No hw writes (Rule 26).
dependencies 2 imports · 0 importers
imports: nx_gate_verdict.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
| 24 | const FB_MAGIC_40500: i64 = 40500 |
| 26 | const FB_M8388607: i64 = 8388607 |
| 27 | const FB_M8388608: i64 = 8388608 |
| 28 | const FB_HDR: i64 = 16 |
| 29 | const FB_LAYENT: i64 = 24 |
| 30 | const FB_TRI: i64 = 84 |
| 31 | const FB_LID: i64 = 4 |
| 32 | const FB_Q: i64 = 1000 |
| 33 | const FB_MODE: i64 = 420 |
| 34 | const FB_MAXDEG: i64 = 150 |
| 35 | const FB_SCR: i64 = 4096 |
| 36 | const FB_BANDS: i64 = 48 |
| 37 | const FB_MINPTS: i64 = 24 |
| 38 | const FB_PROFMAX: i64 = 200 |
functions
| 40 | func fb_puts(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: main |
| 45 | func fb_pn(v: i64) -> i64 { nxi_out(v); return 0 } |
| 46 | func fb_rd32(b: *u8, o: i64) -> i64 |
| 49 | func fb_wr32(b: *u8, o: i64, v: i64) -> i64 called by 1: fb_run |
| 53 | func fb_f32mul(b: *u8, o: i64, mul: i64) -> i64 |
| 66 | func fb_f32of(v: i64) -> i64 called by 1: fb_run |
| 78 | func fb_streq(a: *u8, b: *u8) -> i64 called by 1: main |
| 83 | func fb_atoi(s: *u8) -> i64 called by 1: main |
| 89 | func fb_isqrt(v: i64) -> i64 called by 1: fb_bulge |
| 96 | func fb_sin(d: i64) -> i64 called by 1: fb_cos |
| 106 | func fb_cos(d: i64) -> i64 { return fb_sin(d + 90) } |
| 109 | func fb_bulge(deg: i64) -> i64 |
| 121 | func fb_takes(layer: i64) -> i64 |
| 130 | func fb_loadprof(path: *u8, prof: *i64) -> i64 |
| 171 | func fb_run(inp: *u8, outp: *u8, deg: i64, lo: i64, hi: i64, profpath: *u8, out: *i64) -> i64 |
| 371 | func fb_gate() -> i64 |
| 399 | func main(argc: i64, argv: *i64) -> i64 |