code wiki / _hdl_build / nx_myo.nx

nx_myo.nx

buildroot/runtime/_hdl_build/nx_myo.nx

9644 B184 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_myo.nx -- PIPELINE STAGE 2: VOLUME-PRESERVING MUSCLE BOUND TO BONE. The industry's second stage is "volume-preserving meshes bound to the bones to calculate authentic muscle bulging and flexing". An audit found this stage completely untouched in our stack: what we called muscle was ONE scaled envelope at 82 percent of the skin radius -- a shell, not a muscle, bound to nothing, conserving nothing, incapable of bulging. ★THE DEFINING PROPERTY, and the reason this is a real muscle rather than a bump that grows: VOLUME IS CONSERVED. A muscle belly is very nearly incompressible, so when its ends are drawn together it does not simply get shorter -- it must get THICKER by exactly the amount that keeps its volume constant. That is why a flexed biceps bulges, and it is a hard arithmetic constraint rather than an artistic choice: length x cross-section = constant => radius = r0 * sqrt(L0 / L) A generator that merely thickened a muscle by some tuned factor would look approximately right and be unfalsifiable. This one is checkable: measure the volume before and after and it must not move. BOUND TO BONE: a muscle spans an ORIGIN on one bone and an INSERTION on another, so flexing the joint between them shortens it and the bulge follows from the joint angle -- no separate muscle animation, no hand-authored bulge curve. The joint angle is the only input. nx_myo <origin_len> <flex_deg> -> the muscle's state at that joint angle nx_myo 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_myo.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 my_streq my_gate gv_ctr sys_mmap gv_head gv_puts sys_write my_length my_cos my_sin my_isqrt my_volume gv_check gv_puts ↻ my_radius my_isqrt ↻ gv_verdict gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap gv_journal sys_openat_append sys_mmap ↻ gv_catn sys_mmap ↻ sys_munmap ↻ sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real gv_cat sys_write ↻ sys_close sys_munmap ↻ my_atoi my_length ↻ my_radius ↻ my_volume ↻

structs

none

consts

25const MY_MAGIC_40500: i64 = 40500
27const MY_Q: i64 = 1000
28const MY_R0: i64 = 100
29const MY_TOL: i64 = 30
30const MY_MAXDEG: i64 = 150

functions

32func my_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
37func my_pn(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
38func my_streq(a: *u8, b: *u8) -> i64
called by 1: main
43func my_atoi(s: *u8) -> i64
called by 1: main
49func my_isqrt(v: i64) -> i64
called by 2: my_lengthmy_radius
58func my_sin(d: i64) -> i64
called by 1: my_cos
68func my_cos(d: i64) -> i64 { return my_sin(d + 90) }
called by 1: my_length calls 1: my_sin
72func my_length(lever: i64, deg: i64) -> i64
called by 2: my_gatemain calls 2: my_cosmy_isqrt
79func my_radius(r0: i64, L0: i64, L: i64) -> i64
called by 2: my_gatemain calls 1: my_isqrt
85func my_volume(L: i64, r: i64) -> i64 { return L * r * r / MY_Q }
called by 2: my_gatemain
86func my_gate() -> i64
156func main(argc: i64, argv: *i64) -> i64