code wiki / (root) / nx_print_e2e_test.nx

nx_print_e2e_test.nx

buildroot/runtime/nx_print_e2e_test.nx

4252 B110 linesdepth 13pulls 31 transitivereach 0 importersview sourcekind gate/prooftopic print
docsdependenciesstructsconstsfunctions

about

nx_print_e2e_test.nx -- THE end-to-end integration demo. Single runnable composes every shipped primitive into the operator-side workflow: 1. Build a synthetic mesh (Voron-cube-style tetrahedron at unit scale -- real STL load is operator-side via nx_stl_load_binary on a file buffer; we use the synthetic mesh in-test). 2. Run the full slicer pipeline (nx_slice_pipeline) to produce G-code into a memory buffer. 3. Write the G-code bytes to stdout (fd 1) so the operator can pipe to a .gcode file. 4. Build the Moonraker POST /printer/print/start request bytes for filename "cube.gcode" with API key "demo". 5. Write the Moonraker request bytes to stderr (fd 2) so the operator can inspect / pipe them into curl / nc for upload. 6. Return 0 if every step succeeded. Operator workflow: $ ./nx_print_e2e > cube.gcode 2> moonraker.req (then operator uploads cube.gcode + sends moonraker.req) Assertions (in-test verification): - G-code buffer non-empty + contains expected markers - Moonraker request buffer non-empty + contains expected markers - Both written to their respective fds expect_exit: 0 license_tier: ORIGINAL

dependencies 9 imports · 0 importers

nx_syscalls.nx nx_mesh.nx nx_mesh_print_check.nx nx_bvh.nx nx_machine_graph.nx nx_material_profile.nx nx_gcode_emit.nx nx_slice_pipeline.nx nx_moonraker_client.nx nx_print_e2e_test.nx

imports: nx_syscalls.nxnx_mesh.nxnx_mesh_print_check.nxnx_bvh.nxnx_machine_graph.nxnx_material_profile.nxnx_gcode_emit.nxnx_slice_pipeline.nxnx_moonraker_client.nx

imported by: nobody (leaf or entry point)

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

main nx_mesh_make_tetrahedron nx_mesh_alloc sys_mmap nx_mesh_set_vertex nx_mesh_set_triangle 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 ↻ nx_gcex_filament_xsect_q14 nx_muldiv_i64 nx_i128_alloc nx_i128_mul_i64 nx_i128_mul_u64 nx_i128_neg nx_i128_div_i64 nx_i128_is_neg nx_i128_neg ↻ nx_i128_udiv_u64 nx_gemit_preamble nx_gemit_cstr nx_gemit_byte nx_gemit_int sys_mmap ↻ nx_int_to_decimal nx_fmt_reverse nx_gemit_bytes nx_gemit_byte ↻ nx_gemit_q14 sys_mmap ↻ nx_q14_to_decimal nx_int_to_decimal ↻ nx_gemit_bytes ↻ nx_slice_pipe_run nx_mesh_bbox_compute

structs

none

consts

40const Q14: i64 = 16384

functions

42func smoke_contains(buf: *u8, len: i64, needle: *u8) -> i64
called by 1: main
60func main() -> i64