code wiki / (root) / nx_slice_pipeline_test.nx

nx_slice_pipeline_test.nx

buildroot/runtime/nx_slice_pipeline_test.nx

4074 B112 linesdepth 13pulls 30 transitivereach 0 importersview sourcekind gate/prooftopic slice
docsdependenciesstructsconstsfunctions

about

nx_slice_pipeline_test.nx -- INTEGRATION TEST of every P0-P3.2 primitive. Tetrahedron mesh -> bvh -> multi-layer slice -> contour -> perimeter + infill -> full Klipper G-code. Tetrahedron at unit-mm scale (Q14_ONE = 16384), layer_height 0.2mm = 3277 Q14. Z range 0..16384, so ~5 layers fit (3277, 6554, 9831, 13108, 16385/clip). Each layer's slice is a smaller right triangle (top of tetrahedron shrinks toward apex). The pipeline produces: - preamble (M104/M140/etc) - per-layer: ;LAYER:N + M106 + G0/G1 travel + G1 extrude perimeter + G0/G1 infill segments - postamble (M104 S0 + M84) Closed-form invariants: (a) Pipeline returns positive layer count (>= 4 layers). (b) Final emitter buffer > 1000 bytes (enough for preamble + layers + postamble). (c) Output contains preamble markers (M104 S215, G28, M109). (d) Output contains per-layer markers (";LAYER:0", ";LAYER:1"). (e) Output contains perimeter print moves (G1 X with E value). (f) Output contains postamble markers (M104 S0, M84). (g) E_acc grew during printing (filament actually extruded). expect_exit: 0 license_tier: ORIGINAL

dependencies 8 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_slice_pipeline_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.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

38const Q14: i64 = 16384

functions

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