code wiki / _hdl_build / nx_profile_fit_output_t320.nx

nx_profile_fit_output_t320.nx

buildroot/runtime/_hdl_build/nx_profile_fit_output_t320.nx

44504 B847 linesdepth 4pulls 6 transitivereach 0 importersview sourcekind tooltopic profile
docsdependenciesstructsconstsfunctions

about

nx_profile_fit.nx -- ★MEASURED CROSS-SECTION PROFILES FROM A REAL ANATOMICAL REFERENCE. This is the Infinigen method, done sovereignly: their creature lofting threads NURBS surfaces through profile sections taken from REAL references (nurbs_data). Ours threaded ELLIPSES -- and a human cross section is not an ellipse (flat back, spinal furrow, sternal hollow, deltoid shelf, iliac flare). This organ SLICES an oracle mesh at every station height, clusters each slice into torso / arm / leg / head, fits the section's bounding ellipse, and emits the DIMENSIONLESS deviation of the real outline from that ellipse as a per-angle ratio. ★WHAT IS AND IS NOT TAKEN FROM THE ORACLE: only the SHAPE PRIOR (a per-mille ratio per angle, 1000 = on the ellipse). Every SIZE stays procedural -- the generator still decides stature, breadth, build and dimorphism. So this cannot become "ship the scanned body": it is a measured shape rule the emitter applies to whatever body the rule engine asks for, exactly as Infinigen applies profiles from refs to a genome. Oracle provenance/licence is written into the emitted file header by the caller's manifest. nx_profile_fit <oracle.nxmesh> <out.dat> [step_permil] [canon_out.dat] [part_id] ORGAN MODE: supply part_id and the oracle is declared to BE that single part -- no band gate, no limb clustering. Absent it, the body path is unchanged. license_tier: ORIGINAL expect_exit: 0

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_buf_dyn.nx nx_itoa_lib.nx nx_atomic_rewrite.nx nx_profile_fit_output_t320.nx

imports: nx_syscalls.nxnx_buf_dyn.nxnx_itoa_lib.nxnx_atomic_rewrite.nx

imported by: nobody (leaf or entry point)

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

main pf_output_run pf_hw sys_write pf_satoi sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ pf_sin_fill sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close pf_rdbits pf_f32mul pf_rdbits ↻ pf_output_new sys_mmap ↻ pf_puts nx_bo_append nx_bo_state pf_putint nxi_buf nx_bo_append ↻ pf_fit_section

structs

none

consts

24const PF_Q14: i64 = 16384
25const PF_BIG: i64 = 2000000000
26const PF_M8388607: i64 = 8388607
27const PF_M8388608: i64 = 8388608
28const PF_POSQ0: i64 = 4096
29const PF_TARGET: i64 = 200000
30const PF_MAGIC_40500: i64 = 40500
34const PF_NB: i64 = 48
35const PF_MAXST: i64 = 256 // station slices
36const PF_MAXPT: i64 = 4096 // section points held per station
37const PF_XBINS: i64 = 128 // x-histogram bins used to separate torso from limbs
38const PF_GAP: i64 = 2 // empty x-bins that separate two clusters
39const PF_MAXRUN: i64 = 8
40const PF_MAXPARTS: i64 = 8
41const PF_MAXK: i64 = 12 // control rings kept per part after factorisation
44const PF_PTORSO: i64 = 0
45const PF_PARM: i64 = 1
46const PF_PLEG: i64 = 2
47const PF_PHEAD: i64 = 4
49const PF_TORSO_LO: i64 = 430
50const PF_TORSO_HI: i64 = 908
54const PF_ARM_LO: i64 = 470
55const PF_ARM_HI: i64 = 838
56const PF_LEG_LO: i64 = 60
57const PF_LEG_HI: i64 = 452
58const PF_HEAD_LO: i64 = 852

functions

60func pf_hw(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 2: pf_output_runmain calls 1: sys_write
61func pf_pn(v: i64) -> i64
called by 1: pf_output_run calls 2: sys_mmapsys_write
70func pf_satoi(s: *u8) -> i64
called by 1: pf_output_run
75func pf_rdbits(b: *u8, o: i64) -> i64
78func pf_f32mul(b: *u8, o: i64, mul: i64) -> i64
called by 1: pf_output_run calls 1: pf_rdbits
91func pf_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: pf_fit_section
92func pf_wrap(d: i64) -> i64 { var x: i64 = d % 360; if x < 0 { x = x + 360 } return x }
called by 1: pf_fit_section
94func pf_sin_fill(t: *i64) -> i64
called by 1: pf_output_run
101func pf_output_new(pos: *i64) -> *NxBufOwned
called by 2: pf_output_runmain calls 1: sys_mmap
107func pf_putint(buf: *NxBufOwned, pos: *i64, v: i64, sep: i64) -> i64
117func pf_puts(buf: *NxBufOwned, pos: *i64, s: *u8) -> i64
128func pf_output_commit(buf: *NxBufOwned, pos: *i64, path: *u8) -> i64
153func pf_fit_section(px: *i64, pz: *i64, idx: *i64, cnt: i64, sinT: *i64, fit: *i64, rat: *i64, nb: i64) -> i64
243func pf_symmetrize(rat: *i64, nb: i64) -> i64
called by 1: pf_output_run calls 1: sys_mmap
264func pf_factorise(cY: *i64, cRA: *i64, cRB: *i64, cXC: *i64, cZC: *i64, base: i64, n: i64, K: i64, sel: *i64) -> i64
called by 1: pf_output_run
306func pf_emit_part(buf: *NxBufOwned, pos: *i64, cY: *i64, cRA: *i64, cRB: *i64, cXC: *i64, cZC: *i64,
called by 1: pf_output_run calls 2: pf_putspf_putint
333func pf_landmark(cY: *i64, cR: *i64, base: i64, n: i64, lo: i64, hi: i64, kind: i64) -> i64
called by 1: pf_output_run
351func pf_output_run(argc: i64, argv: *i64) -> i64
806func main(argc: i64, argv: *i64) -> i64