code wiki / _hdl_build / nx_body_proc.nx
nx_body_proc.nx
buildroot/runtime/_hdl_build/nx_body_proc.nx
about
nx_body_proc.nx -- ★SOVEREIGN PROCEDURAL BODY-CANON GENERATOR (Infinigen-style). Infinigen is the CAPABILITY
benchmark -- infinite variety of bodies GENERATED procedurally from parameters + a seed, ZERO hand-crafted
or scanned assets. This is the sovereign version: it does not store a body, it stores the RULES that make
one. It emits a canon.dat (the P/R/F rows nx_body_gen reads) computed from anthropometric FUNCTIONS of a
few high-level knobs, with seeded procedural noise so no two seeds are identical.
nx_body_proc <out.dat> <sex 0-1000> <build 0-1000> <musc 0-1000> <noise 0-1000> <seed> [stylize 0-1000]
sex 0=male anatomy .. 1000=female (shoulders<->hips, waist, bust)
build 0=lean .. 1000=heavy (girth added at waist/limbs)
musc 0=soft .. 1000=muscular (limb girth + muscle-relief amplitude)
noise individual variation amplitude, per-mille of each radius (0=canonical template)
seed any integer -> a specific individual
stylize 0=realistic .. 1000=anime/stylized (bigger head, longer legs, slimmer limps, bigger eyes)
license_tier: ORIGINAL expect_exit: 0
dependencies 1 imports · 0 importers
imports: nx_syscalls.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
| 16 | const K_MAGIC_1750: i64 = 1750 |
| 17 | const K_MAGIC_1000000: i64 = 1000000 |
| 18 | const K_MAGIC_2654435761: i64 = 2654435761 |
| 19 | const K_MAGIC_1013904223: i64 = 1013904223 |
| 20 | const K_MAGIC_65536: i64 = 65536 |
| 28 | const BP_TROCH: i64 = 530 |
| 29 | const BP_ACROMION: i64 = 818 |
| 403 | const BP_SKJ: i64 = 64 |
functions
| 32 | func pr_step(st: *i64) -> i64 { var x: i64 = st[0]; x = x ^ (x << 13); x = x ^ ((x >> 7) & 0x1ffffffffffff); x = x ^ (x << 17); st[0] = x & 0x7fffffffffffffff; return st[0] } |
| 34 | func pr_pm(st: *i64, amp: i64) -> i64 { if amp <= 0 { return 0 } let r: i64 = pr_step(st) % (2*amp + 1); return r - amp } |
| 36 | func pw(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n+1 } sys_write(fd, s, n); return 0 } |
| 38 | func wint(b: *u8, pos: *i64, v: i64, c: i64) -> i64 |
| 49 | func satoi(s: *u8) -> i64 { var i: i64=0; var n: i64=0; var sg: i64=1; if s[0]==(45 as u8){sg=0-1;i=1} called by 1: main |
| 59 | func emitR(b: *u8, pos: *i64, st: *i64, noise: i64, y: i64, xoff: i64, zoff: i64, ra: i64, rb: i64) -> i64 |
| 67 | func emitPm(b: *u8, pos: *i64, st: *i64, noise: i64, mir: i64, rot: i64, ox: i64, oy: i64, oz: i64, mat: i64) -> i64 |
| 87 | func emitPmZ(b: *u8, pos: *i64, st: *i64, noise: i64, mir: i64, rot: i64, ox: i64, oy: i64, oz: i64, mat: i64, rotz: i64) -> i64 |
| 95 | func emitP(b: *u8, pos: *i64, st: *i64, noise: i64, mir: i64, rot: i64, ox: i64, oy: i64, oz: i64) -> i64 |
| 104 | func emitDigitP(b: *u8, pos: *i64, st: *i64, fx: i64, fz: i64, baseY: i64, tipY: i64, rad: i64, |
| 119 | func emitLimbTube(b: *u8, pos: *i64, st: *i64, noise: i64, n: i64, y0: i64, y1: i64, x0: i64, x1: i64, calls 1: emitR |
| 154 | func emitRaySet(b: *u8, pos: *i64, st: *i64, cx: i64, halfw: i64, baseY: i64, maxLen: i64, radB: i64, |
| 173 | func emitDigit(b: *u8, pos: *i64, st: *i64, fx: i64, fz: i64, baseY: i64, tipY: i64, rad: i64) -> i64 |
| 193 | func emitNose(b: *u8, pos: *i64, st: *i64, sexf: i64, sty: i64, faceZ: i64, mat: i64) -> i64 |
| 232 | func emitLips(b: *u8, pos: *i64, st: *i64, sexf: i64, sty: i64, faceZ: i64, mat: i64) -> i64 |
| 244 | func emitChin(b: *u8, pos: *i64, st: *i64, sexf: i64, sty: i64, faceZ: i64, mat: i64) -> i64 |
| 263 | func emitChinZ(b: *u8, pos: *i64, st: *i64, sexf: i64, sty: i64, headRb: i64, mat: i64) -> i64 |
| 295 | func emitLipZ(b: *u8, pos: *i64, st: *i64, sty: i64, headRb: i64, mat: i64, lipY: i64, full: i64) -> i64 |
| 326 | func emitBrowZ(b: *u8, pos: *i64, st: *i64, sexf: i64, sty: i64, headRb: i64, mat: i64) -> i64 |
| 353 | func emitBrow(b: *u8, pos: *i64, st: *i64, sexf: i64, sty: i64, ex: i64, faceZ: i64, mat: i64) -> i64 |
| 367 | func emitEar(b: *u8, pos: *i64, st: *i64, sty: i64, ex: i64, ez: i64, mat: i64) -> i64 |
| 378 | func emitEye(b: *u8, pos: *i64, st: *i64, ey: i64, ex: i64, ez: i64, r: i64, mat: i64) -> i64 |
| 387 | func emitF(b: *u8, pos: *i64, part: i64, y: i64, yw: i64, th: i64, tw: i64, amp: i64) -> i64 |
| 404 | func bp_skel_load(path: *u8, J: *i64, stature: i64) -> i64 |
| 456 | func main(argc: i64, argv: *i64) -> i64 |