code wiki / _hdl_build / nx_body_gen.nx
nx_body_gen.nx
buildroot/runtime/_hdl_build/nx_body_gen.nx
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
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
structs
| none |
consts
| 21 | const BG_MAGIC_3000: i64 = 3000 |
| 22 | const BG_MAGIC_1000000000: i64 = 1000000000 |
| 23 | const BG_MAGIC_1000000: i64 = 1000000 |
| 24 | const BG_MAGIC_2000000: i64 = 2000000 |
| 25 | const BG_MAGIC_8388608: i64 = 8388608 |
| 26 | const BG_MAGIC_8388607: i64 = 8388607 |
| 27 | const BG_MAGIC_1750: i64 = 1750 |
| 29 | const BG_Q14: i64 = 16384 |
| 30 | const BG_MAGIC_40500: i64 = 40500 |
| 33 | const BG_MAXTRI: i64 = 600000 |
| 41 | const BG_MAXRING: i64 = 8192 |
| 42 | const BG_MAXFEAT: i64 = 4096 |
| 49 | const BG_MAXPART: i64 = 2048 |
| 52 | const BG_PSUB: i64 = 512 |
| 53 | const BG_MAXRS: i64 = 256 |
| 55 | const BG_NCAP: i64 = 1000000 |
| 66 | const BG_NBMAX: i64 = 96 |
| 70 | const BG_MAXPROF: i64 = 2048 |
| 71 | const BG_PROFCLAMP: i64 = 300 // a single bad measured row can never deform the body more than +/-30% |
| 74 | const BG_PROFEDGE: i64 = 45 |
| 75 | const BG_NLAYER: i64 = 3 |
| 76 | const BG_BONEF: i64 = 400 // bone core radius = 40% of the skin radius (the skeletal armature) |
| 77 | const BG_MUSCF: i64 = 820 // muscle envelope = 82% of the skin radius (muscle bellies fill toward skin) |
functions
| 89 | func 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 |
| 99 | func 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 } |
| 104 | func bg_pn(v: i64) -> i64 { nxi_out(v); return 0 } |
| 105 | func bg_satoi(s: *u8) -> i64 { var i: i64=0; var n: i64=0 called by 1: main |
| 107 | func bg_sin_fill(t: *i64) -> i64 called by 1: main |
| 112 | func bg_wrap(d: i64) -> i64 { var x: i64=d%360; if x<0 { x=x+360 } return x } |
| 114 | func bg_angsep(a: i64, b: i64) -> i64 |
| 126 | func bg_relief(part: i64, ymil: i64, th: i64, fP: *i64, fY: *i64, fYw: *i64, fT: *i64, fTw: *i64, fA: *i64, nf: i64) -> i64 |
| 156 | func bg_shape_basis(part: i64, ymil: i64, th: i64, sinT: *i64) -> i64 |
| 222 | func 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 |
| 227 | func bg_cmr(p0: i64, p1: i64, p2: i64, p3: i64, t: i64) -> i64 |
| 235 | func bg_f32(v: i64, scale: i64) -> i64 called by 1: main |
| 250 | func bg_wr32(b: *u8, o: i64, v: i64) -> i64 called by 1: main |
| 257 | func bg_rdint(b: *u8, pos: *i64, end: i64) -> i64 |
| 294 | func bg_parse_open(b: *u8, len: i64, oP: *i64, oY: *i64, oYw: *i64, oT: *i64, oTw: *i64, cnt: *i64) -> i64 |
| 321 | func bg_in_open(part: i64, ymil: i64, thd: i64, oP: *i64, oY: *i64, oYw: *i64, oT: *i64, oTw: *i64, n: i64) -> i64 |
| 336 | func bg_parse_canon(b: *u8, len: i64, ry: *i64, rx0: *i64, rz0: *i64, ra: *i64, rb: *i64, |
| 419 | func bg_parse_prof(b: *u8, len: i64, sP: *i64, sY: *i64, sR: *i64, nbo: *i64) -> i64 |
| 468 | func 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 |
| 469 | func bg_prof_smooth(sR: *i64, row: i64, b: i64, nb: i64) -> i64 |
| 475 | func bg_prof(part: i64, ymil: i64, dq: i64, sP: *i64, sY: *i64, sR: *i64, ns: i64, nb: i64, hf: i64) -> i64 |
| 560 | func main(argc: i64, argv: *i64) -> i64 |