code wiki / (root) / nx_bedmesh_emit_test.nx

nx_bedmesh_emit_test.nx

buildroot/runtime/nx_bedmesh_emit_test.nx

4800 B114 linesdepth 10pulls 23 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_bedmesh_emit_test.nx -- prove that slicer-side bed-mesh compensation emits VARYING Z within a single XY extrusion move. Industry baseline: every major slicer emits ONE Z per layer; G1 extrusion moves carry only X/Y/E/F. This smoke shows we emit G1 X Y Z E F PER SEGMENT with Z varying as the move crosses the probed bed mesh. The EXCEED proof. Closed-form invariants: (a) Long move subdivided into >= 10 segments at 5mm max segment (b) Emitted G-code contains multiple ";Z=" markers (we count G1 ... Z) (c) Z varies non-trivially -- buf contains multiple distinct Z coordinate strings (proved by length-of-output > flat-baseline) (d) With a flat (zero-delta) bed mesh: all emitted Z == z_base (no spurious compensation) (e) Bowl bed: Z at move midpoint > Z at move start (passes through high) expect_exit: 0 license_tier: ORIGINAL

dependencies 7 imports · 0 importers

nx_syscalls.nx nx_polygon.nx nx_slice_contour.nx nx_machine_graph.nx nx_material_profile.nx nx_bed_mesh.nx nx_gcode_emit.nx nx_bedmesh_emit_test.nx

imports: nx_syscalls.nxnx_polygon.nxnx_slice_contour.nxnx_machine_graph.nxnx_material_profile.nxnx_bed_mesh.nxnx_gcode_emit.nx

imported by: nobody (leaf or entry point)

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

main nx_machine_graph_qidi_xmax nx_machine_graph_alloc sys_mmap nx_material_profile_generi nx_material_profile_alloc sys_mmap ↻ nx_bed_mesh_new sys_mmap ↻ nx_bed_mesh_set_point 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_extrude_to_bedmes nx_abs nx_bed_mesh_z_at_layer nx_bed_mesh_z_offset nx_gcex_E_delta_for_move nx_gcex_move_length_q14 nx_isqrt nx_gcex_E_delta_q14 nx_muldiv_i64 ↻ nx_gemit_cstr nx_gemit_byte nx_gemit_q14 sys_mmap ↻ nx_q14_to_decimal nx_int_to_decimal nx_fmt_reverse nx_gemit_bytes nx_gemit_byte ↻

structs

none

consts

29const Q14: i64 = 16384

functions

32func smoke_count(buf: *u8, len: i64, needle: *u8) -> i64
called by 2: smoke_containsmain
52func smoke_contains(buf: *u8, len: i64, needle: *u8) -> i64
called by 1: main calls 1: smoke_count
57func main() -> i64