nx_obj_export.nx
buildroot/runtime/nx_obj_export.nx
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 1 imports · 1 importers
imports: nx_syscalls.nx
imported by: nx_obj_export_gate.nx
structs
| none |
consts
| none |
functions
| 7 | func oe_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: write_obj |
| 8 | func 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 |
| 9 | func oe_num(d: *u8, o: i64, v: i64) -> i64 |
| 21 | func write_obj(vbuf: *i64, fbuf: *i64, nv: i64, nf: i64, path: *u8) -> i64 |