code wiki / _hdl_build / nx_myoattach.nx
nx_myoattach.nx
buildroot/runtime/_hdl_build/nx_myoattach.nx
about
nx_myoattach.nx -- ★MUSCLE ATTACHMENTS DERIVED FROM BONE LANDMARKS, never typed.
★THE LAW THIS APPLIES, learned in this lane on the brow ridge: "NEVER TYPE A PLACEMENT COORDINATE
THAT THE PARENT ALREADY KNOWS." A muscle does not have a height; it has ATTACHMENTS -- an origin on
one bone and an insertion on another -- and its height is a CONSEQUENCE of where those bones are.
nx_myotable still carries typed per-mille stations, which means every future muscle is another
opportunity to type a plausible-looking number. This session already measured what that costs: the
biacromial breadth sat at 52% of its true value for the life of the organ because it was typed.
★★THE MECHANISM THAT MAKES ~700 MUSCLES REACHABLE WITHOUT 700 GUESSES: an attachment is
(joint_a, joint_b, t) -- a point t per-mille of the way along the bone spanning two joints that
nx_skelgen ALREADY EMITS. So an attachment is specified ANATOMICALLY ("the proximal third of the
humerus") and its coordinate is derived, at any stature, any sex, scale-free, forever. Typing stops
being possible for the quantity that was being got wrong.
⚠AND IT IS A CROSS-ARTIFACT CHECK, which is why it earns its place now rather than later: the derived
station and nx_myoset's typed station are two independent statements about the same muscle. This organ
REPORTS the disagreement per muscle. Per the lane's law, a disagreement NAMES A NUMBER TO GO LOOK UP
-- it does not tell you which side is wrong -- so the teeth here are on the MECHANISM and the
disagreements are emitted as EVIDENCE, never silently "corrected".
nx_myoattach report <skel.dat>
nx_myoattach selftest <skel.dat>
license_tier: ORIGINAL expect_exit: 0 No hw writes (Rule 26).
dependencies 1 imports · 0 importers
imports: nx_gate_verdict.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
| 26 | const MA_MAGIC_2100: i64 = 2100 |
| 27 | const MA_MAGIC_1750: i64 = 1750 |
| 29 | const MA_MAXJ: i64 = 64 |
| 30 | const MA_MM: i64 = 1000 |
| 31 | const MA_NM: i64 = 21 |
| 32 | const MA_TYPED: i64 = 8 // the first 8 have typed counterparts in nx_myoset; the rest are new |
| 33 | const MA_S: i64 = 8 // muscle row: o_ja, o_jb, o_t, i_ja, i_jb, i_t, peak, ACTUATED JOINT |
| 42 | const MA_INVALID: i64 = 0 - 1 |
| 44 | const J_HIP: i64 = 0 |
| 45 | const J_L5: i64 = 1 |
| 46 | const J_C7: i64 = 2 |
| 47 | const J_ACR: i64 = 5 |
| 48 | const J_ELB: i64 = 6 |
| 49 | const J_WRI: i64 = 7 |
| 50 | const J_HIPJ: i64 = 9 |
| 51 | const J_KNEE: i64 = 10 |
| 52 | const J_ANK: i64 = 11 |
| 53 | const J_TOE: i64 = 12 |
| 54 | const J_HEEL: i64 = 13 |
| 55 | const J_ATLAS: i64 = 3 |
| 56 | const J_VTX: i64 = 4 |
| 57 | const J_HAND: i64 = 8 |
functions
| 59 | func ma_iabs(v: i64) -> i64 { if v < 0 { return 0-v } return v } |
| 60 | func ma_isdig(c: i64) -> i64 { if c >= 48 { if c <= 57 { return 1 } } return 0 } called by 1: ma_tok |
| 61 | func ma_tok(b: *u8, n: i64, p: *i64, out: *i64) -> i64 |
| 88 | func ma_nextline(b: *u8, n: i64, p: *i64) -> i64 called by 1: ma_load |
| 96 | func ma_load(path: *u8, JY: *i64, JP: *i64) -> i64 |
| 130 | func ma_table(M: *i64) -> i64 called by 1: main |
| 166 | func ma_depth(JP: *i64, j: i64) -> i64 called by 1: ma_valid |
| 185 | func ma_valid(JP: *i64, M: *i64, m: i64) -> i64 |
| 199 | func ma_point(JY: *i64, ja: i64, jb: i64, t: i64) -> i64 |
| 204 | func ma_origin(JY: *i64, M: *i64, m: i64) -> i64 { return ma_point(JY, M[m*MA_S], M[m*MA_S+1], M[m*MA_S+2]) } |
| 205 | func ma_insert(JY: *i64, M: *i64, m: i64) -> i64 { return ma_point(JY, M[m*MA_S+3], M[m*MA_S+4], M[m*MA_S+5]) } |
| 207 | func ma_permil(v: i64, stature: i64) -> i64 { if stature <= 0 { return 0 } return v * MA_MM / stature } |
| 209 | func ma_typed_o(m: i64) -> i64 |
| 214 | func ma_typed_i(m: i64) -> i64 called by 1: ma_report |
| 219 | func ma_name(m: i64) -> *u8 called by 1: ma_report |
| 243 | func ma_report(JY: *i64, M: *i64, stature: i64) -> i64 |
| 275 | func main(argc: i64, argv: *i64) -> i64 |