code wiki / (root) / nx_bodyatlas.nx

nx_bodyatlas.nx

buildroot/runtime/nx_bodyatlas.nx

39142 B728 linesdepth 2pulls 3 transitivereach 28 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 2 imports · 23 importers

nx_syscalls.nx nx_itrig.nx nx_bodyatlas.nx nx_anat_consistency_gate.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_digitalhuman_census_gate.nx nx_engine_lod_gate.nx

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

imports: nx_syscalls.nxnx_itrig.nx

imported by: nx_anat_consistency_gate.nxnx_anthro_gate.nxnx_authorgen_gate.nxnx_being_showcase.nxnx_biotwin_morpho.nxnx_bodyatlas_explorer.nxnx_bodyatlas_gate.nxnx_bodyatlas_mesh_gate.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_sqprim_gate.nxnx_texture_gate.nx

structs

none

consts

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

functions

66func ba_isqrt(v: i64) -> i64 { if v <= 0 { return 0 } var x: i64 = v; var y: i64 = (x+1)/2; while y < x { x=y; y=(x+v/x)/2 } return x }
67func ba_iabs(v: i64) -> i64 { if v < 0 { return 0-v } return v }
called by 2: sq_volumemain
68func ba_min(a: i64, b: i64) -> i64 { if a < b { return a } return b }
called by 1: ba_part_sdf
69func ba_max(a: i64, b: i64) -> i64 { if a > b { return a } return b }
called by 2: ba_addatlas_render
70func ba_clamp(v: i64, lo: i64, hi: i64) -> i64 { if v<lo {return lo} if v>hi {return hi} return v }
88func ba_ax_defaults() -> i64
96func ba_set_axes(shw: i64, hipw: i64, arm: i64, thigh: i64, calf: i64) -> i64
100func ba_is_arm(nid: i64) -> i64
called by 2: ba_axis_xba_axis_y
108func ba_is_leg(nid: i64) -> i64
called by 1: ba_axis_x
115func ba_knee_y() -> i64
called by 1: ba_axis_y calls 1: ba_ax_defaults
119func ba_axis_x(nid: i64, cx: i64) -> i64
125func ba_axis_y(nid: i64, cy: i64) -> i64
134func ba_add(sys: i64, cx: i64, cy: i64, cz: i64, rx: i64, ry: i64, rz: i64, col: i64, nid: i64) -> i64
153func 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
157func ba_rig_setup() -> i64
240func ba_fwd_fk(py: i64, pz: i64, b1: i64, b2: i64, out: *i64) -> i64
called by 1: atlas_sync_pose
266func atlas_sync_pose() -> i64
297func 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 }
298func atlas_custom_finish() -> i64
309func atlas_part_count() -> i64 { return BA_N }
310func atlas_part_sys(k: i64) -> i64 { let B: *i64 = BA_BOX as *i64; return B[k*BA_STRIDE] }
311func atlas_set_plant(v: i64) -> i64 { BA_PLANT = v; atlas_sync_pose(); return 0 }
called by 1: main calls 1: atlas_sync_pose
312func atlas_ground_off() -> i64 { return BA_GY }
called by 1: main
314func atlas_pose(preset: i64) -> i64
339func atlas_build(preset: i64) -> i64
526func atlas_hand_curl(v: i64) -> i64 { BA_CURL = v; return 0 }
531func ba_piv_ready() -> i64 { if BA_PIV == 0 { return 0 } return 1 }
called by 1: ga_piv
532func ba_piv(j: i64, axis: i64) -> i64
called by 1: ga_piv
538func ba_n() -> i64 { return BA_N }
540func ba_named_count() -> i64
called by 3: mainmainmain
555func ba_systems_present() -> i64
called by 2: mainmain
568func ba_sys_part_count(sys: i64) -> i64
called by 1: main
575func ba_part_color(k: i64) -> i64 { let B: *i64 = BA_BOX as *i64; return B[k*BA_STRIDE+7] }
577func 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 2: mainmain
580func ba_part_sdf(k: i64, x: i64, y: i64, z: i64) -> i64
called by 2: ba_sdfba_nearest calls 2: ba_isqrtba_min
609func ba_smin(a: i64, b: i64) -> i64
called by 1: ba_sdf
618func ba_sdf(x: i64, y: i64, z: i64, mask: i64) -> i64
643func ba_nearest(x: i64, y: i64, z: i64, mask: i64) -> i64
662func atlas_render(fb: *i64, W: i64, H: i64, yaw: i64, mask: i64, hi_sys: i64) -> i64