code wiki / (root) / nx_material_profile.nx

nx_material_profile.nx

buildroot/runtime/nx_material_profile.nx

14272 B337 linesdepth 2pulls 2 transitivereach 60 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_material_profile.nx -- data-driven filament profile: temps, speeds, cooling, retraction, pressure advance, bridging. Per cardinal NISHI_3D_PRINT_ROADMAP §2.11 + Cardinal 11: every material-specific value lives here, parameterized. No "magic 215°C" in the slicer. Material registry is operator-owned per cardinal feedback-user-owns-every-bit; future nx_calibrate (P5) will derive operator-specific overrides from a 10-minute auto- calibration print. Per cardinal feedback-bits-up-exceed-never-match: material profiles are content-addressed by BLAKE2b hash so peer operators can share + verify profiles without trust. G-code header carries the profile hash (via nx_gcode_manifest) -- a failed print maps back to the exact profile used. Unit conventions per field: - Temperatures: integer °C - Speeds: integer mm/s - Retraction distance: integer µm - Percentages: integer 0..100 - Q14 fixed-point: flow ratios, pressure advance (small fractional values where precision matters and a percentage is too coarse) SEED profile = nx_material_profile_generic_pla() conservative defaults appropriate for a first proof print on Christus. These values target SUCCESS over speed; nx_calibrate (P5) will derive operator-tuned values once the printer has been profiled. license_tier: ORIGINAL

dependencies 1 imports · 54 importers

nx_syscalls.nx nx_material_profile.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, +44 more importers in the complete lists below.

imports: nx_syscalls.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_material_profile_test.nxnx_mushroom_overhang_test.nxnx_pillar_physics.nxnx_pillar_physics_test.nxnx_pillar_physics_v21_test.nxnx_polymer_thermal.nxnx_polymer_thermal_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.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_stress.nxnx_stress_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

55struct NxMaterialProfile

consts

36const NX_MAT_PLA: i64 = 0
37const NX_MAT_PETG: i64 = 1
38const NX_MAT_ABS: i64 = 2
39const NX_MAT_ASA: i64 = 3
40const NX_MAT_PC: i64 = 4
41const NX_MAT_TPU: i64 = 5
42const NX_MAT_NYLON: i64 = 6
43const NX_MAT_PA_CF: i64 = 7 // carbon-fibre reinforced nylon
44const NX_MAT_PEEK: i64 = 8 // high-temp engineering
45const NX_MAT_N: i64 = 9
98const NX_MATERIAL_BYTES: i64 = 168 // 21 fields × 8
108const NX_MATERIAL_OK: i64 = 0
109const NX_MATERIAL_ERR_BAD_CLASS: i64 = 1
110const NX_MATERIAL_ERR_BAD_TEMP: i64 = 2
111const NX_MATERIAL_ERR_BAD_SPEED: i64 = 3
112const NX_MATERIAL_ERR_BAD_COOLING: i64 = 4
113const NX_MATERIAL_ERR_BAD_RETRACT: i64 = 5
114const NX_MATERIAL_ERR_BAD_ADVANCED: i64 = 6

functions

47func nx_mat_is_valid(m: i64) -> i64
102func nx_material_profile_alloc() -> *NxMaterialProfile
116func nx_material_profile_validate(p: *NxMaterialProfile) -> i64
called by 1: main calls 1: nx_mat_is_valid
163func nx_material_profile_generic_pla() -> *NxMaterialProfile
197func nx_material_profile_generic_petg() -> *NxMaterialProfile
230func nx_material_profile_generic_abs() -> *NxMaterialProfile
called by 2: mainmain calls 1: nx_material_profile_alloc
262func nx_material_profile_generic_asa() -> *NxMaterialProfile
called by 1: main calls 1: nx_material_profile_alloc
299func nx_material_profile_generic_peek() -> *NxMaterialProfile
328func nx_material_verdict_name(v: i64) -> *u8