code wiki / _hdl_build / nx_skullgen.nx

nx_skullgen.nx

buildroot/runtime/_hdl_build/nx_skullgen.nx

29473 B488 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_skullgen.nx -- F1108/seq900 KEYSTONE: THE SKULL, GENERATED. Inside-out, from the first byte up. OPERATOR, and he was right: "you arent building from the inside out aka a skull to give it structure ... take the skull and bones those should have all been generatable by now then you just layer on top." Every facial feature this program fought with is a property of BONE -- the brow ridge is the supraorbital margin of the frontal bone, the chin is the mental protuberance of the mandible, the cheekbones are the zygomatic arches, the eye sockets are the orbits. We had been sticking those onto a smooth SKIN ovoid, which is why three tuned chin attempts all rendered as lobes stacked under a mouth: pieces stuck on a blob look like pieces stuck on a blob. The structure has to exist first and the surface layers onto it. This organ does NOT store a skull -- it stores the RULES that make one, and emits them as a canon of P/R/F rows that the proven emitter turns into geometry. So the skull inherits spline lofting, true central-difference normals, capped tubes, per-part placement and rotation about Z for free, and it is data generated by anatomy rather than a modelled asset. The oracle it is scored against is the BodyParts3D skull (171,248 real scanned triangles, CC BY-SA 2.1 Japan) -- a RULER, never the product. nx_skullgen <out.dat> [sex 0-1000] [seed] [robust 0-1000] nx_skullgen selftest license_tier: ORIGINAL expect_exit: 0 No hw writes (Rule 26).

dependencies 2 imports · 0 importers

nx_gate_verdict.nx nx_itoa_lib.nx nx_skullgen.nx

imports: nx_gate_verdict.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 sk_streq sk_gate gv_ctr sys_mmap gv_head gv_puts sys_write sk_write sk_emit skP sk_wint skR sk_wint ↻ sk_pm sk_step skF sk_wint ↻ skO sk_wint ↻ sys_openat_wr gv_check gv_puts ↻ sk_count sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close skP ↻ skR ↻ sys_openat_wr ↻ sk_ycheck sys_read_file ↻ sk_tokn gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻

structs

none

consts

23const SK_BUF: i64 = 65536
24const SK_MODE: i64 = 420
25const SK_MINP: i64 = 7
26const SK_MINR: i64 = 30
292const SK_VAULT_FLOOR: i64 = 40 // braincase confined to the upper 60 percent of skull height (seq908)

functions

33func sk_puts(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 1: main
38func sk_pn(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
39func sk_step(st: *i64) -> i64
called by 1: sk_pm
46func sk_pm(st: *i64, amp: i64) -> i64 { if amp <= 0 { return 0 } let r: i64 = sk_step(st) % (2*amp+1); return r - amp }
called by 1: sk_emit calls 1: sk_step
47func sk_streq(a: *u8, b: *u8) -> i64
called by 1: main
52func sk_atoi(s: *u8) -> i64
called by 1: main
58func sk_wint(b: *u8, pos: *i64, v: i64, c: i64) -> i64
called by 4: skRskPskFskO
70func skR(b: *u8, pos: *i64, y: i64, xoff: i64, zoff: i64, ra: i64, rb: i64) -> i64
called by 2: sk_emitsk_gate calls 1: sk_wint
79func skP(b: *u8, pos: *i64, mir: i64, rot: i64, ox: i64, oy: i64, oz: i64, mat: i64, rotz: i64) -> i64
called by 2: sk_emitsk_gate calls 1: sk_wint
86func skF(b: *u8, pos: *i64, part: i64, y: i64, yw: i64, th: i64, tw: i64, amp: i64) -> i64
called by 1: sk_emit calls 1: sk_wint
94func skO(b: *u8, pos: *i64, part: i64, y: i64, yw: i64, th: i64, tw: i64) -> i64
called by 1: sk_emit calls 1: sk_wint
103func sk_emit(b: *u8, pos: *i64, st: *i64, sexf: i64, robust: i64, noise: i64) -> i64
called by 1: sk_write calls 5: skPskRsk_pmskFskO
239func sk_write(path: *u8, sexf: i64, seed: i64, robust: i64, noise: i64) -> i64
called by 2: sk_gatemain calls 2: sk_emitsys_openat_wr
253func sk_count(path: *u8, ch: i64) -> i64
called by 2: sk_gatemain calls 1: sys_read_file
293func sk_tokn(d: *u8, n: i64, p: *i64, out: *i64) -> i64
called by 1: sk_ycheck
319func sk_ycheck(path: *u8, out: *i64) -> i64
called by 1: sk_gate calls 2: sys_read_filesk_tokn
381func sk_gate() -> i64
454func main(argc: i64, argv: *i64) -> i64