code wiki / _hdl_build / nx_myo.nx
nx_myo.nx
buildroot/runtime/_hdl_build/nx_myo.nx
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
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
| 25 | const MY_MAGIC_40500: i64 = 40500 |
| 27 | const MY_Q: i64 = 1000 |
| 28 | const MY_R0: i64 = 100 |
| 29 | const MY_TOL: i64 = 30 |
| 30 | const MY_MAXDEG: i64 = 150 |
functions
| 32 | func 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 |
| 37 | func my_pn(v: i64) -> i64 { nxi_out(v); return 0 } |
| 38 | func my_streq(a: *u8, b: *u8) -> i64 called by 1: main |
| 43 | func my_atoi(s: *u8) -> i64 called by 1: main |
| 49 | func my_isqrt(v: i64) -> i64 |
| 58 | func my_sin(d: i64) -> i64 called by 1: my_cos |
| 68 | func my_cos(d: i64) -> i64 { return my_sin(d + 90) } |
| 72 | func my_length(lever: i64, deg: i64) -> i64 |
| 79 | func my_radius(r0: i64, L0: i64, L: i64) -> i64 |
| 85 | func my_volume(L: i64, r: i64) -> i64 { return L * r * r / MY_Q } |
| 86 | func my_gate() -> i64 |
| 156 | func main(argc: i64, argv: *i64) -> i64 |