code wiki / _hdl_build / nx_body_gen.nx

nx_body_gen.nx

buildroot/runtime/_hdl_build/nx_body_gen.nx

66009 B1070 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tooltopic body
docsdependenciesstructsconstsfunctions

about

nx_body_gen.nx -- ★THE PRODUCT: a SOVEREIGN PROCEDURAL human body, generated from the first byte up. No scanned mesh, no third-party asset: the body is EMITTED from anthropometric parameters (fractions of stature, per-mille). BodyParts3D is the ORACLE we measure against -- never the product. Competitor platforms are benchmarked on CAPABILITY only; none of their assets are used. v2 (GX-23): the body is now built from CONTINUOUS RING PROFILES, not disjoint cylinders. Each part (torso, arm, leg) is ONE tube threaded through control rings and sub-sampled, so there are no seams where segments used to butt together -- that was the largest silhouette defect vs the oracle. Hands and feet are ring extensions of the arm/leg tubes, so they attach continuously. Normals include the taper slope, so shading follows the true surface rather than a stack of cylinders. nx_body_gen <out.nxmesh> <height> [radial] [sub] [relief] [canonpath] [fat] [prof] [?] [hf] ★★THE CANON PATH IS argv[6] AND IT WAS UNDOCUMENTED (seq1377). It is the single most important input -- this emitter carries NO geometry literals, so WHICH canon you hand it is the whole product -- and its absence from this line is why the nx_skullgen -> mesh chain LOOKED non-composable and cost a measurement cycle. Defaults: relief/RLF argv[5], canon argv[6] (knowledge/canon_male.dat), fat argv[7], prof argv[8], hf argv[10]. ★A usage line that omits a positional does not merely under-document it -- it makes every LATER positional unreachable, because you cannot skip one. license_tier: ORIGINAL expect_exit: 0

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_itoa_lib.nx nx_body_gen.nx

imports: nx_syscalls.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

main bg_satoi sys_mmap bg_sin_fill sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close bg_hw sys_write bg_parse_canon sys_mmap ↻ bg_hw ↻ sys_exit bg_rdint bg_parse_open sys_mmap ↻ bg_rdint ↻ bg_parse_prof sys_mmap ↻ bg_rdint ↻ bg_wrap bg_cmr bg_relief bg_angsep bg_wrap ↻ bg_shape_basis bg_angsep ↻ bg_wrap ↻ bg_prof bg_wrap ↻ bg_cmr ↻ bg_prof_smooth bg_prof_at bg_isqrt bg_rot3 bg_in_open bg_angsep ↻

structs

none

consts

21const BG_MAGIC_3000: i64 = 3000
22const BG_MAGIC_1000000000: i64 = 1000000000
23const BG_MAGIC_1000000: i64 = 1000000
24const BG_MAGIC_2000000: i64 = 2000000
25const BG_MAGIC_8388608: i64 = 8388608
26const BG_MAGIC_8388607: i64 = 8388607
27const BG_MAGIC_1750: i64 = 1750
29const BG_Q14: i64 = 16384
30const BG_MAGIC_40500: i64 = 40500
33const BG_MAXTRI: i64 = 600000
41const BG_MAXRING: i64 = 8192
42const BG_MAXFEAT: i64 = 4096
49const BG_MAXPART: i64 = 2048
52const BG_PSUB: i64 = 512
53const BG_MAXRS: i64 = 256
55const BG_NCAP: i64 = 1000000
66const BG_NBMAX: i64 = 96
70const BG_MAXPROF: i64 = 2048
71const BG_PROFCLAMP: i64 = 300 // a single bad measured row can never deform the body more than +/-30%
74const BG_PROFEDGE: i64 = 45
75const BG_NLAYER: i64 = 3
76const BG_BONEF: i64 = 400 // bone core radius = 40% of the skin radius (the skeletal armature)
77const BG_MUSCF: i64 = 820 // muscle envelope = 82% of the skin radius (muscle bellies fill toward skin)

functions

89func bg_rot3(x: i64, y: i64, z: i64, pzc: i64, pzs: i64, prc: i64, prs: i64, pyc: i64, pys: i64, o: *i64) -> i64
called by 1: main
99func bg_hw(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 2: bg_parse_canonmain calls 1: sys_write
104func bg_pn(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
105func bg_satoi(s: *u8) -> i64 { var i: i64=0; var n: i64=0
called by 1: main
107func bg_sin_fill(t: *i64) -> i64
called by 1: main
112func bg_wrap(d: i64) -> i64 { var x: i64=d%360; if x<0 { x=x+360 } return x }
114func bg_angsep(a: i64, b: i64) -> i64
126func bg_relief(part: i64, ymil: i64, th: i64, fP: *i64, fY: *i64, fYw: *i64, fT: *i64, fTw: *i64, fA: *i64, nf: i64) -> i64
called by 1: main calls 1: bg_angsep
156func bg_shape_basis(part: i64, ymil: i64, th: i64, sinT: *i64) -> i64
called by 1: main calls 2: bg_angsepbg_wrap
222func bg_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 }
called by 1: main
227func bg_cmr(p0: i64, p1: i64, p2: i64, p3: i64, t: i64) -> i64
called by 2: bg_profmain
235func bg_f32(v: i64, scale: i64) -> i64
called by 1: main
250func bg_wr32(b: *u8, o: i64, v: i64) -> i64
called by 1: main
257func bg_rdint(b: *u8, pos: *i64, end: i64) -> i64
294func bg_parse_open(b: *u8, len: i64, oP: *i64, oY: *i64, oYw: *i64, oT: *i64, oTw: *i64, cnt: *i64) -> i64
called by 1: main calls 2: sys_mmapbg_rdint
321func bg_in_open(part: i64, ymil: i64, thd: i64, oP: *i64, oY: *i64, oYw: *i64, oT: *i64, oTw: *i64, n: i64) -> i64
called by 1: main calls 1: bg_angsep
336func bg_parse_canon(b: *u8, len: i64, ry: *i64, rx0: *i64, rz0: *i64, ra: *i64, rb: *i64,
called by 1: main calls 4: sys_mmapbg_hwsys_exitbg_rdint
419func bg_parse_prof(b: *u8, len: i64, sP: *i64, sY: *i64, sR: *i64, nbo: *i64) -> i64
called by 1: main calls 2: sys_mmapbg_rdint
468func bg_prof_at(sR: *i64, row: i64, b: i64, nb: i64) -> i64 { return sR[row*BG_NBMAX + ((b%nb)+nb)%nb] }
called by 1: bg_prof_smooth
469func bg_prof_smooth(sR: *i64, row: i64, b: i64, nb: i64) -> i64
called by 1: bg_prof calls 1: bg_prof_at
475func bg_prof(part: i64, ymil: i64, dq: i64, sP: *i64, sY: *i64, sR: *i64, ns: i64, nb: i64, hf: i64) -> i64
called by 1: main calls 3: bg_wrapbg_cmrbg_prof_smooth
560func main(argc: i64, argv: *i64) -> i64