code wiki / (root) / nx_stl_to_gcode_real_test.nx

nx_stl_to_gcode_real_test.nx

buildroot/runtime/nx_stl_to_gcode_real_test.nx

6330 B186 linesdepth 13pulls 34 transitivereach 0 importersview sourcekind gate/prooftopic stl
docsdependenciesstructsconstsfunctions

about

nx_stl_to_gcode_real_test.nx -- HARD REAL TEST end-to-end: hand-constructed binary STL bytes -> nx_stl_load_binary -> nx_slice_pipe_run_v2 -> G-code text with supports + perimeters. Operator directive 2026-05-20: "lets get to some hard real testing" Earlier hard real test (nx_slice_pipe_v2_real) used the in-memory nx_mesh_make_tetrahedron helper -- already pre-converted Q14 vertices, no STL bytes touched. THIS test exercises the COMPLETE real-byte path: 1. Hand-build binary STL byte stream for a 10mm tetrahedron 2. Pass raw bytes through nx_stl_load_binary (real parser, real IEEE 754 float32 -> Q14 conversion via nx_fp32_bytes_to_q14) 3. Feed the parsed mesh into nx_slice_pipe_run_v2 4. Assert structural properties of emitted G-code This proves: external-format bytes -> substrate slicer -> G-code, the workflow an operator would actually use loading a Christus STL. expect_exit: 0 license_tier: ORIGINAL

dependencies 7 imports · 0 importers

nx_syscalls.nx nx_mesh.nx nx_stl.nx nx_machine_graph.nx nx_material_profile.nx nx_gcode_emit.nx nx_slice_pipeline.nx nx_stl_to_gcode_real_test.nx

imports: nx_syscalls.nxnx_mesh.nxnx_stl.nxnx_machine_graph.nxnx_material_profile.nxnx_gcode_emit.nxnx_slice_pipeline.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 put_tri put_f32 nx_stl_load_binary sys_mmap ↻ nx_stl_is_ascii nx_le_read_u32 nx_mesh_alloc sys_mmap ↻ 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 nx_hash_fnv1a_bytes nx_hash_has nx_hash_probe nx_hash_fnv1a_i64 nx_hash_get nx_hash_probe ↻ nx_mesh_get_vertex_x nx_mesh_get_vertex_y nx_mesh_get_vertex_z nx_mesh_set_vertex nx_hash_put nx_hash_probe ↻ nx_mesh_set_triangle nx_mesh_get_vertex_z ↻ nx_machine_graph_qidi_xmax nx_machine_graph_alloc sys_mmap ↻ nx_material_profile_generi nx_material_profile_alloc sys_mmap ↻ nx_gemit_new sys_mmap ↻

structs

none

consts

31const Q14: i64 = 16384
34const F32_ZERO: i64 = 0x00000000 // +0.0
35const F32_TEN: i64 = 0x41200000 // +10.0 (sign 0, exp 130, mant 0x200000)

functions

38func put_f32(buf: *u8, off: i64, bits32: i64) -> i64
called by 1: put_tri
48func put_tri(buf: *u8, off: i64,
called by 1: main calls 1: put_f32
69func smoke_count(buf: *u8, len: i64, needle: *u8) -> i64
called by 1: main
89func main() -> i64