printer.cfg modified - 04.10.2026 - 00:23:10

This commit is contained in:
klipper committed 2026-10-04 00:23:23 +02:00
1 parent 47a102994d
commit 1e320d1cf0
1 file changed
+25 -8
+25 -8
View File
@@ -672,7 +672,11 @@ gcode:
SET_GCODE_VARIABLE MACRO=PRINT_START VARIABLE=thermal_z_comp VALUE={thermal_z_comp} SET_GCODE_VARIABLE MACRO=PRINT_START VARIABLE=thermal_z_comp VALUE={thermal_z_comp}
{ action_respond_info("PRINT_START: hot-nozzle Z compensation +%.3f mm for %d C" % (thermal_z_comp, hotendtemp)) } { action_respond_info("PRINT_START: hot-nozzle Z compensation +%.3f mm for %d C" % (thermal_z_comp, hotendtemp)) }
STATUS_CLEANING STATUS_CLEANING
{% if params.PRINT_MIN is defined and params.PRINT_MAX is defined %}
LINE_PURGE PRINT_MIN={params.PRINT_MIN} PRINT_MAX={params.PRINT_MAX}
{% else %}
LINE_PURGE LINE_PURGE
{% endif %}
STATUS_PRINTING STATUS_PRINTING
[gcode_macro TOUCH_SAVE_Z_OFFSET] [gcode_macro TOUCH_SAVE_Z_OFFSET]
@@ -714,16 +718,18 @@ gcode:
[gcode_macro LINE_PURGE] [gcode_macro LINE_PURGE]
description: Adaptive purge outside the print; safely skips when no free edge exists description: Adaptive purge outside the print; safely skips when no free edge exists
# Object polygons from the slicer do not include brim or skirt. 15 mm covers the # Preferred bounds: PRINT_MIN/PRINT_MAX from Orca (first_layer_print_min/max),
# Orca profile (5 mm brim, skirt 2 mm away with up to 5 loops = ~9.5 mm) plus # which already include brim and skirt, kept footprint_clearance away.
# the squished purge line width. Override per job with CLEARANCE=<mm>. # Fallback: object polygons, which exclude brim and skirt; observed Orca jobs put
variable_clearance: 15.0 # the skirt up to ~12 mm outside them, so polygon_clearance is larger.
variable_footprint_clearance: 5.0
variable_polygon_clearance: 15.0
gcode: gcode:
{% set objects = printer.exclude_object.objects %} {% set objects = printer.exclude_object.objects %}
{% set points = objects | map(attribute='polygon') | sum(start=[]) %} {% set points = objects | map(attribute='polygon') | sum(start=[]) %}
{% set use_footprint = params.PRINT_MIN is defined and params.PRINT_MAX is defined %}
{% set line_length = 100.0 %} {% set line_length = 100.0 %}
{% set wipe_length = 5.0 %} {% set wipe_length = 5.0 %}
{% set clearance = params.CLEARANCE|default(clearance)|float %}
{% set x_offset = printer.configfile.settings.cartographer.x_offset|float %} {% set x_offset = printer.configfile.settings.cartographer.x_offset|float %}
{% set y_offset = printer.configfile.settings.cartographer.y_offset|float %} {% set y_offset = printer.configfile.settings.cartographer.y_offset|float %}
# Both nozzle and protruding Cartographer must remain at least 5 mm inside # Both nozzle and protruding Cartographer must remain at least 5 mm inside
@@ -737,15 +743,26 @@ gcode:
{ action_raise_error("LINE_PURGE requires homed X, Y and Z") } { action_raise_error("LINE_PURGE requires homed X, Y and Z") }
{% elif not printer.extruder.can_extrude %} {% elif not printer.extruder.can_extrude %}
{ action_raise_error("LINE_PURGE requires a hot extruder") } { action_raise_error("LINE_PURGE requires a hot extruder") }
{% elif points|length == 0 %} {% elif not use_footprint and points|length == 0 %}
{ action_respond_info("LINE_PURGE skipped: slicer supplied no object polygons") } { action_respond_info("LINE_PURGE skipped: slicer supplied neither PRINT_MIN/PRINT_MAX nor object polygons") }
{% elif safe_x_max - safe_x_min < line_length + wipe_length or safe_y_max - safe_y_min < line_length + wipe_length %} {% elif safe_x_max - safe_x_min < line_length + wipe_length or safe_y_max - safe_y_min < line_length + wipe_length %}
{ action_respond_info("LINE_PURGE skipped: configured safe area is too small") } { action_respond_info("LINE_PURGE skipped: configured safe area is too small") }
{% else %} {% else %}
{% if use_footprint %}
{% set source = "first-layer footprint (brim/skirt included)" %}
{% set clearance = params.CLEARANCE|default(footprint_clearance)|float %}
{% set object_x_min = params.PRINT_MIN.split(',')[0]|float %}
{% set object_y_min = params.PRINT_MIN.split(',')[1]|float %}
{% set object_x_max = params.PRINT_MAX.split(',')[0]|float %}
{% set object_y_max = params.PRINT_MAX.split(',')[1]|float %}
{% else %}
{% set source = "object polygons (brim/skirt not included)" %}
{% set clearance = params.CLEARANCE|default(polygon_clearance)|float %}
{% set object_x_min = points | map(attribute=0) | min | float %} {% set object_x_min = points | map(attribute=0) | min | float %}
{% set object_x_max = points | map(attribute=0) | max | float %} {% set object_x_max = points | map(attribute=0) | max | float %}
{% set object_y_min = points | map(attribute=1) | min | float %} {% set object_y_min = points | map(attribute=1) | min | float %}
{% set object_y_max = points | map(attribute=1) | max | float %} {% set object_y_max = points | map(attribute=1) | max | float %}
{% endif %}
{% set front_gap = object_y_min - safe_y_min %} {% set front_gap = object_y_min - safe_y_min %}
{% set left_gap = object_x_min - safe_x_min %} {% set left_gap = object_x_min - safe_x_min %}
{% set right_gap = safe_x_max - object_x_max %} {% set right_gap = safe_x_max - object_x_max %}
@@ -791,7 +808,7 @@ gcode:
{% endif %} {% endif %}
G0 Z2 F600 G0 Z2 F600
RESTORE_GCODE_STATE NAME=LINE_PURGE_STATE MOVE=0 RESTORE_GCODE_STATE NAME=LINE_PURGE_STATE MOVE=0
{ action_respond_info("LINE_PURGE used the %s free edge with %.1f mm object clearance" % (edge, clearance)) } { action_respond_info("LINE_PURGE used the %s free edge, %.1f mm from the %s" % (edge, clearance, source)) }
{% endif %} {% endif %}
{% endif %} {% endif %}