code wiki / (root) / nx_stl_write_mesh_test.nx

nx_stl_write_mesh_test.nx

buildroot/runtime/nx_stl_write_mesh_test.nx

4264 B91 linesdepth 6pulls 12 transitivereach 0 importersview sourcekind gate/prooftopic stl
docsdependenciesstructsconstsfunctions

about

nx_stl_write_mesh_test.nx -- KAT gate: the GENERAL mesh exporter writes an ARBITRARY NxMesh to binary STL that the existing reader/slicer pipeline accepts. Proves (a) cube parity with the hardcoded writer, (b) Q14->f32->Q14 units survive EXACTLY end-to-end (10mm corner comes back as 163840 Q14), (c) a NON-cube mesh (quad) also round-trips -> the seam is general, not cube-special. expect_exit: 0.

dependencies 6 imports · 0 importers

nx_syscalls.nx nx_le.nx nx_f32_encode.nx nx_mesh.nx nx_stl_write.nx nx_stl.nx nx_stl_write_mesh_test.nx

imports: nx_syscalls.nxnx_le.nxnx_f32_encode.nxnx_mesh.nxnx_stl_write.nxnx_stl.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap w sys_write nx_mesh_make_cube nx_mesh_alloc sys_mmap ↻ nx_mesh_set_vertex nx_mesh_set_uv nx_mesh_set_triangle chk w ↻ eqi nx_stl_write_mesh nx_le_write_u32 sw_put_mesh_vert nx_le_write_u32 ↻ f32_from_q14 f32_from_i64 nx_mesh_get_vertex_x nx_mesh_get_vertex_y nx_mesh_get_vertex_z nx_le_write_u16 wn sys_mmap ↻ sys_write ↻ nx_le_read_u32 nx_stl_load_binary sys_mmap ↻ nx_stl_is_ascii nx_le_read_u32 ↻ nx_mesh_alloc ↻ nx_stl_next_pow2 nx_hash_new nx_fp32_bytes_to_q14 nx_fp32_bits_to_q14 nx_stl_intern_vertex nx_stl_pack_xyz nx_le_write_u64 nx_le_write_u32 ↻

structs

none

consts

none

functions

14func w(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 2: chkmain calls 1: sys_write
15func wn(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
24func chk(cond: i64, pass: *i64, fail: *i64, label: *u8) -> i64
called by 1: main calls 1: w
29func eqi(a: i64, b: i64) -> i64 { if a == b { return 1 } return 0 }
called by 1: main
31func max_abs_coord(m: *NxMesh) -> i64
46func main() -> i64