From 29e5689752b727d925196b42b927439011f19797 Mon Sep 17 00:00:00 2001 From: Peck07 Date: Wed, 19 Jun 2024 19:18:13 +0200 Subject: [PATCH] feat(macro): random felt wipe --- config/gcode_macro.cfg | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/config/gcode_macro.cfg b/config/gcode_macro.cfg index 58b6b80..b59ab4a 100644 --- a/config/gcode_macro.cfg +++ b/config/gcode_macro.cfg @@ -73,22 +73,29 @@ gcode: description: Wipe on the felt pad gcode: G90 ; absolute + ; felt is roughly X60-88 (88 is the "cutter" end), Y254-250 + + {% set random_x = (range(0, 100) | random) / 10 %} + {% set X_end = 60 + random_x %} + + {% set random_y = (range(0, 40) | random) / 10 %} + {% set Y_end = 254 - random_y %} + G1 Y{Y_end} F1500 {% set i = 3 %} {% for iteration in range(i|int) %} G1 X88 F500 - G1 X65 F500 + G1 X{X_end} F500 {% endfor %} {% for iteration in range(i|int) %} G1 Y249 F500 - G1 Y254 F500 + G1 Y{Y_end} F500 {% endfor %} - G1 Y253.5 F500 {% for iteration in range(i|int) %} G1 X88 F500 - G1 X63 F500 + G1 X{X_end} F500 {% endfor %}