raise and lower around G0

master
Phuck 2 years ago
parent a4c64b79c0
commit 55ec18242c

@ -3,6 +3,8 @@ import sys
XADD = 150 XADD = 150
YADD = 300 YADD = 300
ZDOWN 62.4
ZUP = ZDOWN + 5
def get_xy(line): def get_xy(line):
xmatch = re.search(r"X(\d*\.\d*)", line) xmatch = re.search(r"X(\d*\.\d*)", line)
@ -35,7 +37,13 @@ def rewrite_gcode(infile, outfile):
continue continue
postfix = "" if prefix == "G0" else " F1500" postfix = "" if prefix == "G0" else " F1500"
fp.write(f"{prefix} X{x+XADD} Y{y+YADD}{postfix}\n") lines = f"{prefix} X{x+XADD} Y{y+YADD}{postfix}\n"
# Raise and lower the pen before moving on fresh lines
if prefix == "G0":
lines = f"G0 Z{ZUP}\n{lines}G0 Z{ZDOWN}\n"
fp.write(lines)
fp.close() fp.close()

Loading…
Cancel
Save