code wiki / (root) / nx_body_profile_winding_candidate_t366.nx

nx_body_profile_winding_candidate_t366.nx

buildroot/runtime/nx_body_profile_winding_candidate_t366.nx

84183 B1333 linesdepth 6pulls 12 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 6 imports · 0 importers

nx_syscalls.nx nx_profile_contract.nx nx_body_skin_cut.nx nx_body_rest_registration.nx nx_fio.nx nx_itoa_lib.nx nx_body_profile_winding_candid

imports: nx_syscalls.nxnx_profile_contract.nxnx_body_skin_cut.nxnx_body_rest_registration.nxnx_fio.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_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

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

functions

102func 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
112func 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 }
117func bg_pn(v: i64) -> i64 { nxi_out(v); return 0 }
118func bg_satoi(s: *u8) -> i64 { var i: i64=0; var n: i64=0
called by 1: bg_generate_cut
120func bg_sin_fill(t: *i64) -> i64
called by 1: bg_generate_cut
125func bg_wrap(d: i64) -> i64 { var x: i64=d%360; if x<0 { x=x+360 } return x }
127func bg_angsep(a: i64, b: i64) -> i64
139func 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
184func 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
217func 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
247func 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
303func 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
308func bg_cmr(p0: i64, p1: i64, p2: i64, p3: i64, t: i64) -> i64
316func bg_f32(v: i64, scale: i64) -> i64
called by 1: bg_generate_cut
331func bg_wr32(b: *u8, o: i64, v: i64) -> i64
called by 1: bg_generate_cut
338func bg_rdint(b: *u8, pos: *i64, end: i64) -> i64
375func 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
402func 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
417func bg_parse_canon(b: *u8, len: i64, ry: *i64, rx0: *i64, rz0: *i64, ra: *i64, rb: *i64,
503func bg_scan_nb(b: *u8, len: i64) -> i64
called by 1: bg_generate_cut calls 2: sys_mmapbg_rdint
524func 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
580func 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
581func bg_prof_smooth(sR: *i64, row: i64, b: i64, nb: i64) -> i64
called by 1: bg_prof calls 1: bg_prof_at
587func bg_prof(part: i64, ymil: i64, dq: i64, sP: *i64, sY: *i64, sR: *i64, ns: i64, nb: i64, hf: i64) -> i64
674func bg_ring_direction(y:*i64,start:i64,count:i64)->i64
called by 1: bg_generate_cut
679func bg_reverse_triangle_corners(t:*i64)->i64
called by 1: bg_generate_cut
682func bg_generate_cut(argc: i64, argv: *i64, join:*BgCutJoin) -> i64
1297func bg_join_refuse(j:*BgCutJoin,stage:*u8,code:i64)->i64
1303func bg_recipe_error(stage:*u8,code:i64,e:*i64)->i64
called by 1: main calls 2: bg_hwbg_pn
1308func main(argc:i64,argv:*i64)->i64