nx_mesh3.nx
buildroot/runtime/nx_mesh3.nx
about
nx_mesh3.nx -- the SHARED triangle mesh + STL interchange (real3d census's connective-tissue gap: "CAD,
print, games cannot hand geometry to each other today"; operator 2026-07-03: "make sure all of these things
across the environment are reusable in other areas for robotics, manufacturing, video, vr, etc").
ONE mesh format, MANY consumers: CAD exports it, the printer slices it, games/video render it, robotics
collides against it, VR scenes carry it. Vertices are fx256 integers (the ecosystem fixed-point law);
STL IO is BINARY STL (the industry lingua franca: 80B header, u32 count, 50B/tri) with EXACT round-trip --
fx256 -> IEEE-754 f32 is exact for |v| < 2^24 because /256 is a pure exponent shift, so write->read is
bit-identical (gated). Base-relative, no allocations beyond the caller's arena. license_tier: ORIGINAL
dependencies 2 imports · 9 importers
imports: nx_syscalls.nxnx_f32_hw.nx
imported by: nx_bezier_patch.nxnx_detail_gate.nxnx_mesh3_gate.nxnx_meshthick.nxnx_morph.nxnx_morph_gate.nxnx_partid.nxnx_step_tess.nxnx_subdiv.nx
structs
| none |
consts
| 11 | const M3_MAGIC_1048575: i64 = 1048575 |
| 13 | const M3_MAXV: i64 = 4096 |
| 14 | const M3_MAXT: i64 = 8192 |
functions
| 16 | func m3_hdr(base: i64) -> *i64 { return base as *i64 } // [0]=nverts [1]=ntris |
| 17 | func m3_vert(base: i64, i: i64) -> *i64 { return (base + 64 + i * 24) as *i64 } |
| 18 | func m3_tri(base: i64, i: i64) -> *i64 { return (base + 64 + M3_MAXV * 24 + i * 24) as *i64 } |
| 19 | func m3_bytes() -> i64 { return 64 + M3_MAXV * 24 + M3_MAXT * 24 } |
| 21 | func m3_init(base: i64) -> i64 |
| 27 | func m3_add_vert(base: i64, x: i64, y: i64, z: i64) -> i64 |
| 35 | func m3_add_tri(base: i64, a: i64, b: i64, c: i64) -> i64 |
| 45 | func m3_aabb(base: i64, out: *i64) -> i64 |
| 66 | func m3_fx_to_f32(v: i64) -> i64 { return f32_div(f32_of(v), f32_of(256)) } |
| 68 | func m3_f32_to_fx(bits: i64) -> i64 { return f32_int(f32_mul(bits, f32_of(256))) } |
| 70 | func m3_w32(buf: *u8, off: i64, v: i64) -> i64 called by 1: m3_write_stl |
| 77 | func m3_r32(buf: *u8, off: i64) -> i64 called by 1: m3_read_stl |
| 82 | func m3_write_stl(base: i64, path: *u8) -> i64 |
| 118 | func m3_read_stl(base: i64, path: *u8) -> i64 |
| 165 | func m3_slice_z_count(base: i64, zc: i64) -> i64 |
| 189 | func m3_box(base: i64, cx: i64, cy: i64, cz: i64, hx: i64, hy: i64, hz: i64) -> i64 |