|
|
|
@ -3,6 +3,8 @@ import sys
|
|
|
|
|
|
|
|
|
|
XADD = 150
|
|
|
|
|
YADD = 300
|
|
|
|
|
ZDOWN 62.4
|
|
|
|
|
ZUP = ZDOWN + 5
|
|
|
|
|
|
|
|
|
|
def get_xy(line):
|
|
|
|
|
xmatch = re.search(r"X(\d*\.\d*)", line)
|
|
|
|
@ -35,7 +37,13 @@ def rewrite_gcode(infile, outfile):
|
|
|
|
|
continue
|
|
|
|
|
|
|
|
|
|
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()
|
|
|
|
|
|
|
|
|
|