code wiki / _hdl_build / nx_flexbody.nx

nx_flexbody.nx

buildroot/runtime/_hdl_build/nx_flexbody.nx

19897 B428 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

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

nx_gate_verdict.nx nx_itoa_lib.nx nx_flexbody.nx

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

main fb_streq fb_gate gv_ctr sys_mmap gv_head gv_puts sys_write fb_bulge fb_cos fb_sin fb_isqrt gv_check gv_puts ↻ fb_takes fb_run fb_loadprof sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close sys_read_file ↻ fb_rd32 fb_bulge ↻ fb_f32mul fb_rd32 ↻ fb_takes ↻ fb_wr32 fb_f32of sys_openat_wr gv_verdict gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap gv_journal sys_openat_append

structs

none

consts

24const FB_MAGIC_40500: i64 = 40500
26const FB_M8388607: i64 = 8388607
27const FB_M8388608: i64 = 8388608
28const FB_HDR: i64 = 16
29const FB_LAYENT: i64 = 24
30const FB_TRI: i64 = 84
31const FB_LID: i64 = 4
32const FB_Q: i64 = 1000
33const FB_MODE: i64 = 420
34const FB_MAXDEG: i64 = 150
35const FB_SCR: i64 = 4096
36const FB_BANDS: i64 = 48
37const FB_MINPTS: i64 = 24
38const FB_PROFMAX: i64 = 200

functions

40func 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
45func fb_pn(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
46func fb_rd32(b: *u8, o: i64) -> i64
called by 2: fb_f32mulfb_run
49func fb_wr32(b: *u8, o: i64, v: i64) -> i64
called by 1: fb_run
53func fb_f32mul(b: *u8, o: i64, mul: i64) -> i64
called by 1: fb_run calls 1: fb_rd32
66func fb_f32of(v: i64) -> i64
called by 1: fb_run
78func fb_streq(a: *u8, b: *u8) -> i64
called by 1: main
83func fb_atoi(s: *u8) -> i64
called by 1: main
89func fb_isqrt(v: i64) -> i64
called by 1: fb_bulge
96func fb_sin(d: i64) -> i64
called by 1: fb_cos
106func fb_cos(d: i64) -> i64 { return fb_sin(d + 90) }
called by 1: fb_bulge calls 1: fb_sin
109func fb_bulge(deg: i64) -> i64
called by 2: fb_runfb_gate calls 2: fb_cosfb_isqrt
121func fb_takes(layer: i64) -> i64
called by 2: fb_runfb_gate
130func fb_loadprof(path: *u8, prof: *i64) -> i64
called by 1: fb_run calls 1: sys_read_file
171func fb_run(inp: *u8, outp: *u8, deg: i64, lo: i64, hi: i64, profpath: *u8, out: *i64) -> i64
371func fb_gate() -> i64
399func main(argc: i64, argv: *i64) -> i64