nx_modelfacts_lib.nx
buildroot/runtime/nx_modelfacts_lib.nx
about
nx_modelfacts_lib.nx -- 3D MODEL FACT EXTRACTION CORE (C1 of the conversion tier,
knowledge/render_docs_ingest_program.txt). GLB / STL / OBJ / PLY headers -> closed-vocabulary
integer measurements for the refcorpus plane. Completes the MEASURE half of mesh rung R2 and
the twice-queued glb fact-extractor in one composer.
Same walls as nx_mediafacts_lib: no byte from the model file ever flows to output (computed
integers + fixed labels only), and -1 means NOT MEASURED -- never a fabricated zero.
★TRUNCATION HONESTY: text-format counts (OBJ/PLY/ascii-STL) and GLB token counts are only
emitted when the RELEVANT REGION fits the read window; a count over a truncated file would be
a plausible undercount, which is worse than absence. Binary STL's count comes from its HEADER
and is verified against the true file size, so it is window-safe.
Fact slots (flat i64, MDL_N_SLOTS):
[0] format 0=unknown 1=glb 2=stl 3=obj 4=ply
[1] tris (stl) [2] verts (obj/ply) [3] faces (obj/ply) [4] uv_present
[5] glb_json_bytes [6] glb_bin_bytes [7] glb_accessors [8] glb_skinned_prims
[9] vrm_present
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 1 imports · 3 importers
imports: nx_syscalls.nx
imported by: nx_ingest_audit.nxnx_modelfacts.nxnx_modelfacts_gate.nx
structs
| none |
consts
| 20 | const MDL_MAGIC_4096: i64 = 4096 |
| 21 | const MDL_MAGIC_65536: i64 = 65536 |
| 23 | const MDL_N_SLOTS: i64 = 10 |
| 24 | const MDL_FMT_UNKNOWN: i64 = 0 |
| 25 | const MDL_FMT_GLB: i64 = 1 |
| 26 | const MDL_FMT_STL: i64 = 2 |
| 27 | const MDL_FMT_OBJ: i64 = 3 |
| 28 | const MDL_FMT_PLY: i64 = 4 |
functions
| 30 | func mdl_b(buf: *u8, o: i64) -> i64 { return buf[o] as i64 & 0xff } |
| 31 | func mdl_u32le(b: *u8, o: i64) -> i64 { return (b[o] as i64 & 0xff) | ((b[o+1] as i64 & 0xff) << 8) | ((b[o+2] as i64 & 0xff) << 16) | ((b[o+3] as i64 & 0xff) << 24) } called by 1: mdl_probe |
| 32 | func mdl_align4(x: i64) -> i64 { return (x + 3) / 4 * 4 } called by 1: mdl_probe |
| 33 | func mdl_nlen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 36 | func mdl_count(buf: *u8, start: i64, end: i64, needle: *u8) -> i64 |
| 49 | func mdl_num_after(buf: *u8, start: i64, end: i64, needle: *u8) -> i64 |
| 77 | func mdl_starts(buf: *u8, n: i64, s: *u8) -> i64 |
| 86 | func mdl_lines(buf: *u8, end: i64, c0: i64, c1: i64) -> i64 |
| 104 | func mdl_looks_obj(buf: *u8, n: i64) -> i64 |
| 113 | func mdl_probe(buf: *u8, n: i64, file_size: i64, facts: *i64) -> i64 called by 3: mainmainmain calls 7: mdl_startsmdl_u32lemdl_align4mdl_countmdl_num_aftermdl_looks_obj+1 |