code wiki / (root) / nx_obj_import_exact_candidate_t284.nx

nx_obj_import_exact_candidate_t284.nx

buildroot/runtime/nx_obj_import_exact_candidate_t284.nx

16515 B405 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind orphan librarytopic obj
docsdependenciesstructsconstsfunctions

about

nx_obj_import.nx -- sovereign Wavefront OBJ READER. The missing half of nx_obj_export: the ecosystem could WRITE meshes and could not READ them, so no externally-authored geometry could ever enter the pipeline. This is the ingest gate for any licensed/CC scan or sculpt. ★BUILT FOR REAL-WORLD OBJ, NOT JUST OUR OWN EXPORT. Files from Blender/scanners/Commons differ from what nx_obj_export emits in three ways that each break a naive parser: 1. FLOATING-POINT vertex coords ("v 0.123456 -1.5 2.0e-1") -- our exporter writes integers. Parsed into fx1024 fixed point, including exponent notation. 2. NEGATIVE face indices (-1 = most recent vertex), the relative form in the OBJ spec. 3. N-GONS (quads are everywhere in DCC exports) -- fan-triangulated, not rejected. Also tolerates v/vt/vn face forms (a, a/b, a//c, a/b/c), CRLF, and unknown directives. verts land in fx1024 units, matching nx_obj_export/nx_meshgen so the mesh stack composes. usage as a lib: oi_read(path, vbuf, fbuf, vcap, fcap, counts) -> 0 ok, negative on error counts[0]=nv counts[1]=nf license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_obj_import_exact_candidate_

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

structs

241struct OiExactView

consts

19const OI_FX: i64 = 1024
234const OIE_MAX:i64=9223372036854775807
235const OIE_MIN:i64=0-9223372036854775807-1
236const OIE_SYNTAX:i64=-6
237const OIE_RANGE:i64=-7
238const OIE_BUFFER:i64=-8
239const OIE_TRIANGLES_ONLY:i64=0
240const OIE_FAN_UNQUALIFIED:i64=1

functions

21func oi_is_digit(c: i64) -> i64 { if c < 48 { return 0 } if c > 57 { return 0 } return 1 }
23func oi_ws(buf: *u8, n: i64, p: *i64) -> i64
35func oi_eol(buf: *u8, n: i64, p: *i64) -> i64
called by 1: oi_read
46func oi_fx(buf: *u8, n: i64, p: *i64, ok: *i64) -> i64
called by 1: oi_read calls 2: oi_wsoi_is_digit
110func oi_faceref(buf: *u8, n: i64, p: *i64, ok: *i64) -> i64
called by 1: oi_read calls 2: oi_wsoi_is_digit
145func oi_read(path: *u8, vbuf: *i64, fbuf: *i64, vcap: i64, fcap: i64, counts: *i64) -> i64
256func oi_exact_reset(o:*OiExactView,n:i64)->i64
262func oi_decimal_exact(s:*u8,n:i64,value:*i64,power:*i64)->i64
called by 1: oi_exact_scan calls 1: oi_is_digit
307func oi_exact_scaled(v:i64,ex:i64,target:i64,out:*i64)->i64
called by 1: oi_exact_scan
316func oi_exact_space(c:i64)->i64 {if c==32||c==9||c==13{return 1};return 0}
called by 1: oi_exact_token
317func oi_exact_token(b:*u8,end:i64,p:*i64,len:*i64)->i64
called by 1: oi_exact_scan calls 1: oi_exact_space
325func oi_exact_ref(s:*u8,n:i64,nv:i64,out:*i64)->i64
called by 1: oi_exact_scan calls 1: oi_is_digit
348func oi_exact_scan(b:*u8,n:i64,v:*i64,f:*i64,o:*OiExactView,emit:i64,vcap:i64,fcap:i64)->i64
389func oi_read_exact_bytes(b:*u8,n:i64,v:*i64,f:*i64,vcap:i64,fcap:i64,o:*OiExactView)->i64
400func oi_read_exact(path:*u8,v:*i64,f:*i64,vcap:i64,fcap:i64,o:*OiExactView)->i64