code wiki / (root) / nx_body_gen_winding_candidate_t365.nx

nx_body_gen_winding_candidate_t365.nx

buildroot/runtime/nx_body_gen_winding_candidate_t365.nx

83341 B1318 linesdepth 6pulls 11 transitivereach 1 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 5 imports · 1 importers

nx_syscalls.nx nx_body_skin_cut.nx nx_body_rest_registration.nx nx_fio.nx nx_itoa_lib.nx nx_body_gen_winding_candidate_ nx_body_winding_gate_t365.nx

imports: nx_syscalls.nxnx_body_skin_cut.nxnx_body_rest_registration.nxnx_fio.nxnx_itoa_lib.nx

imported by: nx_body_winding_gate_t365.nx

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main bg_recipe_error bg_hw sys_write bg_pn nxi_out nxi_fd sys_mmap nxa_die nxa_lock_take nxa_lock_give nxa_report_overrun ccz_cat_num nxi_buf sys_write ↻ sys_munmap bg_generate_cut bg_satoi sys_mmap ↻ bg_sin_fill sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap ↻ sys_close bg_hw ↻ bg_parse_canon sys_mmap ↻ bg_hw ↻ sys_exit bg_rdint bg_parse_open sys_mmap ↻ bg_rdint ↻ bg_parse_basis sys_mmap ↻ bg_rdint ↻ bg_parse_layers

structs

none

consts

24const BG_SMOOTHSTEP_3_PERMIL: i64 = 3000
25const BG_PERMIL_CUBE: i64 = 1000000000
26const BG_PERMIL_SQ: i64 = 1000000
27const BG_CATMULL_DEN: i64 = 2000000
28const BG_F32_MANT_SCALE: i64 = 8388608
29const BG_F32_MANT_MASK: i64 = 8388607
30const BG_DEFAULT_STATURE_MM: i64 = 1750
32const BG_Q14: i64 = 16384
36const BG_BHASKARA_K: i64 = 40500
45const BG_MAXTRI: i64 = 8388608
53const BG_MAXRING: i64 = 8192
54const BG_MAXFEAT: i64 = 4096
61const BG_MAXPART: i64 = 2048
64const BG_PSUB: i64 = 512
65const BG_MAXRS: i64 = 256
67const BG_NCAP: i64 = 1000000
78const BG_NBMAX: i64 = 96
82const BG_MAXPROF: i64 = 2048
83const BG_PROFCLAMP: i64 = 300 // a single bad measured row can never deform the body more than +/-30%
86const BG_PROFEDGE: i64 = 45
87const BG_NLAYER: i64 = 3
88const BG_BONEF: i64 = 400 // bone core radius = 40% of the skin radius (the skeletal armature)
89const BG_MUSCF: i64 = 820 // muscle envelope = 82% of the skin radius (muscle bellies fill toward skin)
168const BG_WK_RAMP: i64 = 1
169const BG_WK_TRI: i64 = 2
170const BG_WK_RIDGE: i64 = 3
171const BG_YK_FLAT: i64 = 1
172const BG_YK_WAVE_RIB: i64 = 2
173const BG_YK_WAVE_SPAN: i64 = 3
174const BG_HALFTURN_DEG: i64 = 180
178const BG_ROW_BASIS: i64 = 66 // 'B' -- a shape-basis feature row
179const BG_ROW_LAYER: i64 = 76 // 'L' -- a layer palette row
180const BG_LF: i64 = 10 // end of line

functions

101func 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: bg_generate_cut
111func 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 }
116func bg_pn(v: i64) -> i64 { nxi_out(v); return 0 }
117func bg_satoi(s: *u8) -> i64 { var i: i64=0; var n: i64=0
called by 1: bg_generate_cut
119func bg_sin_fill(t: *i64) -> i64
called by 1: bg_generate_cut
124func bg_wrap(d: i64) -> i64 { var x: i64=d%360; if x<0 { x=x+360 } return x }
126func bg_angsep(a: i64, b: i64) -> i64
138func 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: bg_generate_cut calls 1: bg_angsep
183func bg_parse_basis(b: *u8, len: i64, kP: *i64, kYlo: *i64, kYhi: *i64, kTh: *i64, kWk: *i64, kW0: *i64, kW1: *i64, kW2: *i64, kAmp: *i64, kYk: *i64, kP0: *i64, kP1: *i64, kP2: *i64, cnt: *i64) -> i64
called by 1: bg_generate_cut calls 2: sys_mmapbg_rdint
216func bg_parse_layers(b: *u8, len: i64, lR: *i64, lG: *i64, lB: *i64, cnt: *i64) -> i64
called by 1: bg_generate_cut calls 2: sys_mmapbg_rdint
246func bg_shape_basis(part: i64, ymil: i64, th: i64, sinT: *i64, kP: *i64, kYlo: *i64, kYhi: *i64, kTh: *i64, kWk: *i64, kW0: *i64, kW1: *i64, kW2: *i64, kAmp: *i64, kYk: *i64, kP0: *i64, kP1: *i64, kP2: *i64, nk: i64) -> i64
called by 1: bg_generate_cut calls 2: bg_angsepbg_wrap
302func 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: bg_generate_cut
307func bg_cmr(p0: i64, p1: i64, p2: i64, p3: i64, t: i64) -> i64
315func bg_f32(v: i64, scale: i64) -> i64
called by 1: bg_generate_cut
330func bg_wr32(b: *u8, o: i64, v: i64) -> i64
called by 1: bg_generate_cut
337func bg_rdint(b: *u8, pos: *i64, end: i64) -> i64
374func bg_parse_open(b: *u8, len: i64, oP: *i64, oY: *i64, oYw: *i64, oT: *i64, oTw: *i64, cnt: *i64) -> i64
called by 1: bg_generate_cut calls 2: sys_mmapbg_rdint
401func 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: bg_generate_cut calls 1: bg_angsep
416func bg_parse_canon(b: *u8, len: i64, ry: *i64, rx0: *i64, rz0: *i64, ra: *i64, rb: *i64,
502func bg_scan_nb(b: *u8, len: i64) -> i64
called by 1: bg_generate_cut calls 2: sys_mmapbg_rdint
523func bg_parse_prof(b: *u8, len: i64, sP: *i64, sY: *i64, sR: *i64, nbo: *i64, stride: i64) -> i64
called by 1: bg_generate_cut calls 2: sys_mmapbg_rdint
579func bg_prof_at(sR: *i64, row: i64, b: i64, nb: i64) -> i64 { return sR[row*nb + ((b%nb)+nb)%nb] }
called by 1: bg_prof_smooth
580func bg_prof_smooth(sR: *i64, row: i64, b: i64, nb: i64) -> i64
called by 1: bg_prof calls 1: bg_prof_at
586func bg_prof(part: i64, ymil: i64, dq: i64, sP: *i64, sY: *i64, sR: *i64, ns: i64, nb: i64, hf: i64) -> i64
673func bg_ring_direction(y:*i64,start:i64,count:i64)->i64
called by 2: bg_generate_cutmain
678func bg_reverse_triangle_corners(t:*i64)->i64
called by 1: bg_generate_cut
681func bg_generate_cut(argc: i64, argv: *i64, join:*BgCutJoin) -> i64
1282func bg_join_refuse(j:*BgCutJoin,stage:*u8,code:i64)->i64
1288func bg_recipe_error(stage:*u8,code:i64,e:*i64)->i64
called by 1: main calls 2: bg_hwbg_pn
1293func main(argc:i64,argv:*i64)->i64