code wiki / (root) / nx_machine_graph.nx

nx_machine_graph.nx

buildroot/runtime/nx_machine_graph.nx

15479 B373 linesdepth 3pulls 3 transitivereach 54 importersview sourcekind librarytopic machine
docsdependenciesstructsconstsfunctions

about

nx_machine_graph.nx -- data-driven printer description: build volume, kinematics, motion envelope, thermal limits, hardware geometry. No magic numbers anywhere in the slicer (Cardinal 11) -- every printer-specific value lives here, parameterized. Per cardinal NISHI_3D_PRINT_ROADMAP §2.8 + bits-up-exceed axis "cross-printer profiles don't port": adding a new printer to the substrate's slicer is DESCRIBING its NxMachineGraph, NOT rewriting any slicer code. This is the architecture promise that makes P6/P7 multi-printer proofs achievable, not aspirational. Distinct from nx_motion.nx (which is Lucas-Kanade optical flow for video -- totally different concept; printer "motion" here is the kinematic envelope, not frame-to-frame estimation). Unit conventions per field (documented at struct definition): - Build volume in integer millimetres (no sub-mm precision needed) - Nozzle / filament diameter in integer micrometres - Velocities in integer mm/s - Accelerations in integer mm/s² - Temperatures in integer °C - Q14 fixed-point only where ratios are needed (none here yet) Why mixed integer units rather than uniform Q14: Real-world printer specs are quoted in mm/s, mm/s², °C -- the integer units match operator + manufacturer conventions. Slicer composes nx_fp32_q14 + nx_machine_graph at code points where it needs cross-unit math, with explicit conversion. Operator-verified defaults: nx_machine_graph_qidi_xmax3() returns values verified 2026-05-19 against official Qidi US store specs. Operators MUST verify against their actual unit before any real print -- printer-to-printer variance exists even within model. license_tier: ORIGINAL

dependencies 2 imports · 47 importers

nx_syscalls.nx nx_print_process.nx nx_machine_graph.nx nx_auto_supports_v2_target_test.nx nx_bedmesh_emit_test.nx nx_cad_exceed.nx nx_cad_page.nx nx_cad_prims2_test.nx nx_cad_test.nx nx_christus_integration_test.nx nx_csg_fillet_test.nx nx_csg_test.nx nx_csg_torus_test.nx

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

imports: nx_syscalls.nxnx_print_process.nx

imported by: nx_auto_supports_v2_target_test.nxnx_bedmesh_emit_test.nxnx_cad_exceed.nxnx_cad_page.nxnx_cad_prims2_test.nxnx_cad_test.nxnx_christus_integration_test.nxnx_csg_fillet_test.nxnx_csg_test.nxnx_csg_torus_test.nxnx_cube_to_gcode_test.nxnx_dcc_slice_probe.nxnx_dcc_to_print_test.nxnx_estimate.nxnx_estimate_test.nxnx_gcode_arc_test.nxnx_gcode_brim_test.nxnx_gcode_emit.nxnx_gcode_emit_test.nxnx_klipper_gcode_validator_test.nxnx_machine_arch_test.nxnx_machine_graph_test.nxnx_mushroom_overhang_test.nxnx_preflight.nxnx_preflight_test.nxnx_print_e2e_test.nxnx_print_exceed_compose_test.nxnx_print_session.nxnx_print_session_test.nxnx_print_sim.nxnx_print_sim_spaghetti_test.nxnx_print_sim_test.nxnx_slice_auto_supports_test.nxnx_slice_pipe_v2_real_test.nxnx_slice_pipe_v2_test.nxnx_slice_pipeline.nxnx_slice_pipeline_test.nxnx_slicer_lib.nxnx_stl_to_gcode_real_test.nxnx_supports.nxnx_supports_physics_test.nxnx_supports_v2_test.nxnx_underridge_gcode_gate.nxnx_underridge_hook_gcode_gate.nxnx_underridge_hook_petg_gate.nxnx_underridge_master_gate.nxnx_vessel_gcode.nx

structs

117struct NxMachineGraph

consts

42const NX_KIN_CARTESIAN: i64 = 0
43const NX_KIN_COREXY: i64 = 1
44const NX_KIN_DELTA: i64 = 2
45const NX_KIN_SCARA: i64 = 3
46const NX_KIN_HBOT: i64 = 4
50const NX_KIN_ROBOT_6DOF: i64 = 5 // arm-mounted nozzle (DIW concrete,
52const NX_KIN_GANTRY: i64 = 6 // large-format gantry (concrete
55const NX_KIN_CONVEYOR: i64 = 7 // belt printer (Creality CR-30,
58const NX_KIN_N: i64 = 8
110const NX_EXT_BOWDEN: i64 = 0
111const NX_EXT_DIRECT_DRIVE: i64 = 1
112const NX_EXT_TOOLCHANGER: i64 = 2
113const NX_EXT_N: i64 = 3
160const NX_MACHINE_BYTES: i64 = 176 // 22 fields × 8
170const NX_MACHINE_OK: i64 = 0
171const NX_MACHINE_ERR_BAD_KIN: i64 = 1
172const NX_MACHINE_ERR_BAD_EXT: i64 = 2
173const NX_MACHINE_ERR_BAD_BUILD: i64 = 3
174const NX_MACHINE_ERR_BAD_THERMAL: i64 = 4
175const NX_MACHINE_ERR_BAD_MOTION: i64 = 5
176const NX_MACHINE_ERR_BAD_HARDWARE: i64 = 6

functions

60func nx_kin_is_valid(k: i64) -> i64
75func nx_kinematics_finite_z(k: i64) -> i64
called by 1: main
82func nx_kinematics_xy_decoupled(k: i64) -> i64
called by 1: main
94func nx_kinematics_5_axis_or_more(k: i64) -> i64
called by 1: main
102func nx_kinematics_bed_translates(k: i64) -> i64
called by 1: main
164func nx_machine_graph_alloc() -> *NxMachineGraph
180func nx_machine_graph_validate(g: *NxMachineGraph) -> i64
called by 1: main calls 1: nx_kin_is_valid
215func nx_machine_graph_qidi_xmax3() -> *NxMachineGraph
253func nx_machine_graph_prusa_mk4() -> *NxMachineGraph
called by 2: mainmain calls 1: nx_machine_graph_alloc
286func nx_machine_graph_voron_2_4() -> *NxMachineGraph
called by 2: mainmain calls 1: nx_machine_graph_alloc
320func nx_machine_graph_bambu_x1c() -> *NxMachineGraph
called by 2: mainmain calls 1: nx_machine_graph_alloc
353func nx_machine_set_process(g: *NxMachineGraph, process_class: i64) -> i64
called by 1: main calls 1: nx_process_is_valid
364func nx_machine_verdict_name(v: i64) -> *u8
called by 1: main