code wiki / (root) / nx_stl_write.nx

nx_stl_write.nx

buildroot/runtime/nx_stl_write.nx

4742 B108 linesdepth 5pulls 7 transitivereach 27 importersview sourcekind librarytopic stl
docsdependenciesstructsconstsfunctions

about

nx_stl_write.nx -- SOVEREIGN DCC export: procedural mesh -> binary STL. The creator/writer half (nx_stl is the reader). Emits the exact 1980s binary STL the existing slicer->gcode->klipper pipeline consumes: 80B header + u32 n_tris + per-tri 50B (12B normal + 9 f32 verts + 2B attr). Floats via the new f32_from_i64 encoder; bytes via nx_le_write_u32. This is the model->print seam: geometry authored here feeds nx_stl_load_binary -> nx_slice_* -> nx_gcode_* -> nx_klipper_gcode_validator. No dup (nx_stl had no writer). license_tier: ORIGINAL.

dependencies 4 imports · 26 importers

nx_syscalls.nx nx_le.nx nx_f32_encode.nx nx_mesh.nx nx_stl_write.nx nx_cad_exceed.nx nx_cad_page.nx nx_cad_prims2_test.nx nx_cad_test.nx nx_csg_fillet_test.nx nx_csg_rot_gate.nx nx_csg_rotxz_gate.nx nx_csg_scene_gate.nx nx_csg_test.nx nx_csg_torus_test.nx

diagram shows first 10 each side; +0 more imports, +16 more importers in the complete lists below.

imports: nx_syscalls.nxnx_le.nxnx_f32_encode.nxnx_mesh.nx

imported by: nx_cad_exceed.nxnx_cad_page.nxnx_cad_prims2_test.nxnx_cad_test.nxnx_csg_fillet_test.nxnx_csg_rot_gate.nxnx_csg_rotxz_gate.nxnx_csg_scene_gate.nxnx_csg_test.nxnx_csg_torus_test.nxnx_cube_to_gcode_test.nxnx_dcc_slice_probe.nxnx_dcc_to_print_test.nxnx_mesh_decimate_gate.nxnx_print_e2e_gate.nxnx_stl_write_mesh_test.nxnx_stl_write_test.nxnx_underridge_cleaner.nxnx_underridge_cleaner_gate.nxnx_underridge_gcode_gate.nxnx_underridge_gel_gate.nxnx_underridge_hook_gate.nxnx_underridge_hook_gcode_gate.nxnx_underridge_hook_petg_gate.nxnx_underridge_master_gate.nxnx_vessel_emit.nx

structs

none

consts

none

functions

16func sw_put_vert(buf: *u8, off: i64, x: i64, y: i64, z: i64) -> i64
24func nx_stl_write_cube(buf: *u8, S: i64) -> i64
78func sw_put_mesh_vert(buf: *u8, off: i64, m: *NxMesh, vidx: i64) -> i64
85func nx_stl_write_mesh(buf: *u8, m: *NxMesh) -> i64