Merge pull request #25023 from sebastianohl/main

CAM: fixing drill handling, as KinetiNC does not implement G81 etc. correctly
This commit is contained in:
sliptonic
2025-11-28 11:54:08 -06:00
committed by GitHub

View File

@@ -363,6 +363,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
@@ -415,6 +424,20 @@ 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)