code wiki / (root) / nx_obj_export.nx

nx_obj_export.nx

buildroot/runtime/nx_obj_export.nx

4245 B76 linesdepth 3pulls 5 transitivereach 4 importersview sourcekind librarytopic obj
docsdependenciesstructsconstsfunctions

about

nx_obj_export.nx -- sovereign Wavefront OBJ writer for the bestiary meshes (game/DCC reuse: engines + Blender import OBJ+normals far cleaner than the print-only STL). Takes the nx_meshgen verts+tris, computes SMOOTH per-vertex normals (accumulate face normals -> normalize), and emits v / vn / f (with //vn indices), 1-indexed. Buffered (one write). Verts stay in the mesh's fx1024 units (importers rescale). license_tier: ORIGINAL

dependencies 3 imports · 3 importers

nx_syscalls.nx nx_vecmath.nx nx_vnormals_lib.nx nx_obj_export.nx nx_obj_export_gate.nx nx_vnormals_gate.nx nx_xport_lib.nx

imports: nx_syscalls.nxnx_vecmath.nxnx_vnormals_lib.nx

imported by: nx_obj_export_gate.nxnx_vnormals_gate.nxnx_xport_lib.nx

structs

none

consts

none

functions

12func oe_cat(d: *u8, o: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){d[o+i]=s[i]; i=i+1} return o+i }
called by 1: write_obj
13func oe_num(d: *u8, o: i64, v: i64) -> i64
called by 1: write_obj calls 1: sys_mmap
25func write_obj(vbuf: *i64, fbuf: *i64, nv: i64, nf: i64, path: *u8) -> i64
called by 1: main calls 3: sys_mmapoe_catoe_num