code wiki / (root) / nx_bodyatlas.nx

nx_bodyatlas.nx

buildroot/runtime/nx_bodyatlas.nx

39081 B729 linesdepth 2pulls 4 transitivereach 27 importersview sourcekind librarytopic bodyatlas
docsdependenciesstructsconstsfunctions

about

nx_bodyatlas.nx -- ★HOLISTIC ANATOMICAL BEING (operator 2026-07-10, ref zygotebody.com + sloyd.ai/3d-human-model-generator): "we are doing humans... generate holistic beings with parts". A whole-body human generated procedurally with ALL of its anatomical SYSTEMS present as independently peelable layers -- exactly ZygoteBody's peel-a-layer atlas, and Sloyd's parametric body generator, but 100% integer + sovereign (own SDF + integer ortho ray-march, no ML/Blender/externals). 8 SYSTEMS (bit in the visibility mask): 0 SKIN 1 MUSCLE 2 SKELETON 3 DIGESTIVE 4 CIRCULATORY 5 RESPIRATORY 6 URINARY 7 NERVOUS ~77 parts / ~60 NAMED structures head-to-toe (skull..foot; heart,lungs,liver,kidneys,brain,spinal cord,...). PARAMETRIC (Sloyd-style): height / girth / frame-width / sex presets reshape the whole being from one seed. PEEL (ZygoteBody-style): render with any subset of systems visible -> strip skin to see muscle, strip muscle to see skeleton + viscera, isolate one system. Each part carries a system id + a name id -> the atlas can name parts. This extends the layered idea in nx_anatstack (bone->muscle->fat->skin peel) from the FACE to the WHOLE BEING and from tissue layers to full anatomical SYSTEMS. license_tier: ORIGINAL

dependencies 3 imports · 22 importers

nx_syscalls.nx nx_itrig.nx nx_vecmath.nx nx_bodyatlas.nx nx_anthro_gate.nx nx_authorgen_gate.nx nx_being_showcase.nx nx_biotwin_morpho.nx nx_bodyatlas_explorer.nx nx_bodyatlas_gate.nx nx_bodyatlas_mesh_gate.nx nx_dance_emit.nx nx_digitalhuman_census_gate.nx nx_engine_lod_gate.nx

diagram shows first 10 each side; +0 more imports, +12 more importers in the complete lists below.

imports: nx_syscalls.nxnx_itrig.nxnx_vecmath.nx

imported by: nx_anthro_gate.nxnx_authorgen_gate.nxnx_being_showcase.nxnx_biotwin_morpho.nxnx_bodyatlas_explorer.nxnx_bodyatlas_gate.nxnx_bodyatlas_mesh_gate.nxnx_dance_emit.nxnx_digitalhuman_census_gate.nxnx_engine_lod_gate.nxnx_engine_scene_gate.nxnx_footplant_gate.nxnx_genome.nxnx_gltf_anim_gate.nxnx_gltf_mesh_gate.nxnx_gltf_scene_gate.nxnx_hands_gate.nxnx_isosurf_gate.nxnx_phong_gate.nxnx_retarget_emit.nxnx_retarget_showcase.nxnx_texture_gate.nx

structs

none

consts

16const BS_MAGIC_1024: i64 = 1024
17const BS_MAGIC_4096: i64 = 4096
18const BS_MAGIC_1000000000: i64 = 1000000000
19const BS_MAGIC_999999999: i64 = 999999999
20const BS_MAGIC_1500: i64 = 1500
21const BS_MAGIC_5800: i64 = 5800
22const BS_MAGIC_6000: i64 = 6000
23const BS_MAGIC_8600: i64 = 8600
24const BS_MAGIC_1600: i64 = 1600
25const BS_MAGIC_1360: i64 = 1360
26const BS_MAGIC_1090: i64 = 1090
27const BS_MAGIC_1078: i64 = 1078
28const BS_MAGIC_65536: i64 = 65536
29const BS_MAGIC_3072: i64 = 3072
30const BS_MAGIC_1000000: i64 = 1000000
31const BS_MAGIC_1400: i64 = 1400
32const BS_MAGIC_2600: i64 = 2600
33const BS_MAGIC_3200: i64 = 3200
34const BS_MAGIC_2120: i64 = 2120
35const BS_MAGIC_1780: i64 = 1780
38const BS_SKIN: i64 = 0
39const BS_MUS: i64 = 1
40const BS_SKEL: i64 = 2
41const BS_DIG: i64 = 3
42const BS_CIRC: i64 = 4
43const BS_RESP: i64 = 5
44const BS_URI: i64 = 6
45const BS_NERV: i64 = 7
46const BS_NSYS: i64 = 8
48const BA_STRIDE: i64 = 13 // per-part: sys, cx,cy,cz, rx,ry,rz, col, nid, rmax, b1, b2 (FK bone ids, 0=none)
49const BA_CAP: i64 = 160
61const BA_NB: i64 = 11
85const BA_ANCH_SH: i64 = 520 // shoulder pivot y
86const BA_ANCH_HIP: i64 = 40 // hip pivot y is -40
87const BA_ANCH_KNEE: i64 = 430 // knee pivot y is -430
88const BA_ANCH_ANKLE: i64 = 830 // ankle pivot y is -830 (tibia bottom -828 / foot top -824): the calf landmark
609const BA_SMK: i64 = 34 // ★de-clay (operator: 'clay monsters'): smooth-union radius for SKIN parts
662const BA_ZMAX: i64 = 560

functions

67func ba_isqrt(v: i64) -> i64 { return vm_isqrt(v) }
called by 2: ba_part_sdfatlas_render calls 1: vm_isqrt
68func ba_iabs(v: i64) -> i64 { if v < 0 { return 0-v } return v }
69func ba_min(a: i64, b: i64) -> i64 { if a < b { return a } return b }
called by 1: ba_part_sdf
70func ba_max(a: i64, b: i64) -> i64 { if a > b { return a } return b }
called by 2: ba_addatlas_render
71func ba_clamp(v: i64, lo: i64, hi: i64) -> i64 { if v<lo {return lo} if v>hi {return hi} return v }
89func ba_ax_defaults() -> i64
97func ba_set_axes(shw: i64, hipw: i64, arm: i64, thigh: i64, calf: i64) -> i64
101func ba_is_arm(nid: i64) -> i64
called by 2: ba_axis_xba_axis_y
109func ba_is_leg(nid: i64) -> i64
called by 1: ba_axis_x
116func ba_knee_y() -> i64
called by 1: ba_axis_y calls 1: ba_ax_defaults
120func ba_axis_x(nid: i64, cx: i64) -> i64
126func ba_axis_y(nid: i64, cy: i64) -> i64
135func ba_add(sys: i64, cx: i64, cy: i64, cz: i64, rx: i64, ry: i64, rz: i64, col: i64, nid: i64) -> i64
154func ba_nin(nid: i64, a: i64, b: i64, c: i64, d: i64) -> i64 { if nid==a {return 1} if nid==b {return 1} if nid==c {return 1} if nid==d {return 1} return 0 }
called by 1: ba_rig_setup
158func ba_rig_setup() -> i64
241func ba_fwd_fk(py: i64, pz: i64, b1: i64, b2: i64, out: *i64) -> i64
called by 1: atlas_sync_pose
267func atlas_sync_pose() -> i64
298func atlas_custom_reset() -> i64 { BA_N = 0; BA_TALL = BS_MAGIC_1024; BA_GIRTH = BS_MAGIC_1024; BA_WIDE = BS_MAGIC_1024; BA_SEX = 0; ba_set_axes(BS_MAGIC_1024, BS_MAGIC_1024, BS_MAGIC_1024, BS_MAGIC_1024, BS_MAGIC_1024); return 0 }
299func atlas_custom_finish() -> i64
310func atlas_part_count() -> i64 { return BA_N }
311func atlas_part_sys(k: i64) -> i64 { let B: *i64 = BA_BOX as *i64; return B[k*BA_STRIDE] }
312func atlas_set_plant(v: i64) -> i64 { BA_PLANT = v; atlas_sync_pose(); return 0 }
called by 1: main calls 1: atlas_sync_pose
313func atlas_ground_off() -> i64 { return BA_GY }
called by 1: main
315func atlas_pose(preset: i64) -> i64
340func atlas_build(preset: i64) -> i64
527func atlas_hand_curl(v: i64) -> i64 { BA_CURL = v; return 0 }
532func ba_piv_ready() -> i64 { if BA_PIV == 0 { return 0 } return 1 }
called by 1: ga_piv
533func ba_piv(j: i64, axis: i64) -> i64
called by 1: ga_piv
539func ba_n() -> i64 { return BA_N }
541func ba_named_count() -> i64
called by 3: mainmainmain
556func ba_systems_present() -> i64
called by 2: mainmain
569func ba_sys_part_count(sys: i64) -> i64
called by 1: main
576func ba_part_color(k: i64) -> i64 { let B: *i64 = BA_BOX as *i64; return B[k*BA_STRIDE+7] }
578func ba_part_bone(k: i64) -> i64 { let B: *i64 = BA_BOX as *i64; let b2: i64 = B[k*BA_STRIDE+12]; if b2 != 0 { return b2 } return B[k*BA_STRIDE+11] }
called by 3: mainmainmain
581func ba_part_sdf(k: i64, x: i64, y: i64, z: i64) -> i64
called by 2: ba_sdfba_nearest calls 2: ba_isqrtba_min
610func ba_smin(a: i64, b: i64) -> i64
called by 1: ba_sdf
619func ba_sdf(x: i64, y: i64, z: i64, mask: i64) -> i64
644func ba_nearest(x: i64, y: i64, z: i64, mask: i64) -> i64
663func atlas_render(fb: *i64, W: i64, H: i64, yaw: i64, mask: i64, hi_sys: i64) -> i64