code wiki / _hdl_build / nx_biotwin_morpho.nx

nx_biotwin_morpho.nx

buildroot/runtime/_hdl_build/nx_biotwin_morpho.nx

10179 B255 linesdepth 3pulls 4 transitivereach 2 importersview sourcekind librarytopic biotwin
docsdependenciesstructsconstsfunctions

about

nx_biotwin_morpho.nx -- BIOTWIN rung-1 LIBRARY: the MORPHOMETRIC-DERIVATION engine (board axis 8, COU-1). The biotwin board's computed gap_queue ranks morphometric-derivation #1 (it blocks 4 QOIs). This is the DERIVATION TRANSFORM: geometry -> numbers. It COMPOSES with the visualise-body substrate (nx_bodyatlas ba_sdf -- the same sovereign integer SDF being that the Gx north star ships and that QOI[0] visualise- own-body scores 833 on) and does NOT duplicate it. From the SDF it extracts geometric landmarks, then derives standard anthropometric morphometric axes -- and CARRIES PROVENANCE ON EVERY AXIS (which input landmarks, which transform, the input measurement resolution). Integer/fixed-point only (the no-float doctrine holds for derivation; the FEM/UQ float collision is a SEPARATE, still-unratified question). RULER (not ours): the banked anthropometric canon in knowledge/anthropometry_banked.txt -- 7.5-heads, leg/stature, arm/stature, shoulder/hip, fingertip-drop. The same external canon nx_anthro_gate grades the being against; this engine turns that gate's ad-hoc measurements into first-class, provenanced axes. THE FENCE (rule-26 never-brick applied to bodies): bm_fence_blocked() carries a PERMANENT PLANTED LIE -- a caller claim that a morphometric measurement is "genomic/clinical ready" -- and a CLAMP that forces it back to measurement-only every run. A morphometric MEASUREMENT can never be silently promoted to a clinical or genomic CLAIM: fence_blocked>=1 proves the clamp fires, mechanically, on every invocation. This composes with the board's axis-21 fence; it does not replace it. license_tier: ORIGINAL

dependencies 2 imports · 2 importers

nx_syscalls.nx nx_bodyatlas.nx nx_biotwin_morpho.nx nx_biotwin_morphometrics.nx nx_biotwin_morphometrics_gate.nx

imports: nx_syscalls.nxnx_bodyatlas.nx

imported by: nx_biotwin_morphometrics.nxnx_biotwin_morphometrics_gate.nx

structs

none

consts

24const N_MAGIC_100000: i64 = 100000
25const N_MAGIC_1200: i64 = 1200
26const N_MAGIC_99999: i64 = 99999
27const N_MAGIC_1469598103: i64 = 1469598103
30const N_LM: i64 = 8
31const LM_CROWN: i64 = 0
32const LM_SOLE: i64 = 1
33const LM_CHIN: i64 = 2
34const LM_CROTCH: i64 = 3
35const LM_SHW: i64 = 4
36const LM_HIPW: i64 = 5
37const LM_ACRO: i64 = 6
38const LM_FTIP: i64 = 7
41const N_AX: i64 = 5
42const AX_STRIDE: i64 = 7
43const AX_VAL: i64 = 0 // derived value (fixed-point per axis)
44const AX_LO: i64 = 1 // canon band low (banked)
45const AX_HI: i64 = 2 // canon band high (banked)
46const AX_RES: i64 = 3 // coarsest input landmark resolution (+- SDF units)
47const AX_NM: i64 = 4 // axis name (str ptr as i64)
48const AX_TF: i64 = 5 // transform formula (str ptr as i64)
49const AX_IN: i64 = 6 // input landmarks (str ptr as i64)
51const N_PROMO: i64 = 3 // promotion-fence claim slots
52const NECK_RATIO_PCT: i64 = 60 // chin/neck = where head width collapses below this fraction of head max width

functions

55func mo_scan_down(x: i64, z: i64, yhi: i64, ylo: i64) -> i64
called by 1: bm_measure calls 1: ba_sdf
63func mo_scan_up(x: i64, z: i64, ylo: i64, yhi: i64) -> i64
called by 1: bm_measure calls 1: ba_sdf
71func mo_halfwidth_at(y: i64, lim: i64) -> i64
called by 1: bm_measure calls 1: ba_sdf
82func bm_measure(preset: i64, LM: *i64) -> i64
154func bm_derive(preset: i64, OUT: *i64) -> i64
226func bm_fence_blocked() -> i64
called by 2: mainmain calls 1: sys_mmap
244func bm_checksum(preset: i64) -> i64
called by 2: mainmain calls 2: sys_mmapbm_derive