code wiki / (root) / nx_print_session.nx

nx_print_session.nx

buildroot/runtime/nx_print_session.nx

4710 B133 linesdepth 13pulls 32 transitivereach 1 importersview sourcekind librarytopic print
docsdependenciesstructsconstsfunctions

about

nx_print_session.nx -- ALL-IN-ONE push-and-play operator entry. Single function takes (mesh, machine, material, layer_h, line_w, infill_pct, output_buffer_capacity) and: 1. nx_preflight_check (5 sanity gates; refuse on UNSAFE) 2. nx_gemit_new + preamble 3. nx_slice_pipe_run (multi-layer slice + perim + infill) (slice_pipe internally calls skirt + postamble) 4. Returns NxPrintSession with: verdict (SAFE_PRINT / REFUSED) preflight_reason (if REFUSED) emitter pointer (G-code bytes in emitter.buf) layer count Per cardinal feedback-engineering-sciences-bits-up-3d-print-first + NISHI_3D_PRINT_BULLETPROOF_PREFLIGHT_ROADMAP: this is the operator-facing "push and play" API. Instead of orchestrating 5+ primitives by hand, operator calls one function -- substrate refuses to emit G-code if any sanity gate fails. Composes EVERY shipped pre-print primitive: nx_preflight (gate) nx_machine_graph (machine envelope) nx_material_profile (material spec) nx_gcode_emit (orchestrator) nx_slice_pipeline (multi-layer) Smoke verifies SAFE case (tetrahedron + Qidi + PLA = G-code produced) + REFUSED case (oversize mesh → no G-code emitted, code fails-loud + verdict carries reason). license_tier: ORIGINAL

dependencies 7 imports · 1 importers

nx_syscalls.nx nx_mesh.nx nx_machine_graph.nx nx_material_profile.nx nx_preflight.nx nx_gcode_emit.nx nx_slice_pipeline.nx nx_print_session.nx nx_print_session_test.nx

imports: nx_syscalls.nxnx_mesh.nxnx_machine_graph.nxnx_material_profile.nxnx_preflight.nxnx_gcode_emit.nxnx_slice_pipeline.nx

imported by: nx_print_session_test.nx

structs

58struct NxPrintSession

consts

45const NX_SESSION_OK: i64 = 0
46const NX_SESSION_REFUSED: i64 = 1
47const NX_SESSION_EMIT_ERR: i64 = 2
65const NX_PRINT_SESSION_BYTES: i64 = 32

functions

49func nx_session_verdict_name(v: i64) -> *u8
called by 1: main
77func nx_print_session_run(mesh: *NxMesh,