code wiki / (root) / nx_mesh3.nx

nx_mesh3.nx

buildroot/runtime/nx_mesh3.nx

8143 B205 linesdepth 2pulls 3 transitivereach 32 importersview sourcekind library
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_f32_hw.nx nx_mesh3.nx nx_bezier_patch.nx nx_detail_gate.nx nx_mesh3_gate.nx nx_meshthick.nx nx_morph.nx nx_morph_gate.nx nx_partid.nx nx_step_tess.nx nx_subdiv.nx

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

11const M3_MAGIC_1048575: i64 = 1048575
13const M3_MAXV: i64 = 4096
14const M3_MAXT: i64 = 8192

functions

16func m3_hdr(base: i64) -> *i64 { return base as *i64 } // [0]=nverts [1]=ntris
17func m3_vert(base: i64, i: i64) -> *i64 { return (base + 64 + i * 24) as *i64 }
18func m3_tri(base: i64, i: i64) -> *i64 { return (base + 64 + M3_MAXV * 24 + i * 24) as *i64 }
19func m3_bytes() -> i64 { return 64 + M3_MAXV * 24 + M3_MAXT * 24 }
called by 17: mainmainmainmainmainmain+11
21func m3_init(base: i64) -> i64
27func m3_add_vert(base: i64, x: i64, y: i64, z: i64) -> i64
35func m3_add_tri(base: i64, a: i64, b: i64, c: i64) -> i64
45func m3_aabb(base: i64, out: *i64) -> i64
called by 1: main calls 2: m3_hdrm3_vert
66func m3_fx_to_f32(v: i64) -> i64 { return f32_div(f32_of(v), f32_of(256)) }
called by 1: m3_write_stl calls 2: f32_divf32_of
68func m3_f32_to_fx(bits: i64) -> i64 { return f32_int(f32_mul(bits, f32_of(256))) }
called by 1: m3_read_stl calls 3: f32_intf32_mulf32_of
70func m3_w32(buf: *u8, off: i64, v: i64) -> i64
called by 1: m3_write_stl
77func m3_r32(buf: *u8, off: i64) -> i64
called by 1: m3_read_stl
82func m3_write_stl(base: i64, path: *u8) -> i64
118func m3_read_stl(base: i64, path: *u8) -> i64
165func m3_slice_z_count(base: i64, zc: i64) -> i64
called by 1: main calls 3: m3_hdrm3_trim3_vert
189func m3_box(base: i64, cx: i64, cy: i64, cz: i64, hx: i64, hy: i64, hz: i64) -> i64