fixing drill handling, as KinetiNC does not implement G81 etc. correctly

This commit is contained in:
Sebastian Ohl
2025-11-03 15:02:14 +01:00
parent 510553a22f
commit a11355e21d

View File

@@ -341,6 +341,15 @@ def parse(pathobj):
outstring = []
command = c.Name
if pathobj.Label == "Drilling" and command in ["G98", "G99"]:
out += linenumber() + "(" + command + " removed as KineticNC do not support it)\n"
continue
if command in ["G85"]:
out += linenumber() + "(" + command + " removed as KineticNC do not support it)\n"
continue
outstring.append(command)
# if modal: suppress the command if it is the same as the last one
@@ -393,6 +402,16 @@ def parse(pathobj):
param + format(float(pos.getValueAs(UNIT_FORMAT)), precision_string)
)
if command in ["G0"] and "Z" not in c.Parameters \
and pathobj.Label == "Drilling" and "R" in currLocation.keys():
if not OUTPUT_DOUBLES:
continue
else:
pos = Units.Quantity(currLocation["R"], FreeCAD.Units.Length)
outstring.append(
"Z" + format(float(pos.getValueAs(UNIT_FORMAT)), precision_string)
)
# store the latest command
lastcommand = command
currLocation.update(c.Parameters)