From a11355e21d24aecb0832cfb57d0dda392903900e Mon Sep 17 00:00:00 2001 From: Sebastian Ohl Date: Mon, 3 Nov 2025 15:02:14 +0100 Subject: [PATCH 1/2] fixing drill handling, as KinetiNC does not implement G81 etc. correctly --- .../Post/scripts/KineticNCBeamicon2_post.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/Mod/CAM/Path/Post/scripts/KineticNCBeamicon2_post.py b/src/Mod/CAM/Path/Post/scripts/KineticNCBeamicon2_post.py index 4e65a33532..dc54985af4 100644 --- a/src/Mod/CAM/Path/Post/scripts/KineticNCBeamicon2_post.py +++ b/src/Mod/CAM/Path/Post/scripts/KineticNCBeamicon2_post.py @@ -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) From 7707dc1ade101533b4bb8936078c17b17d89b2ed Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 3 Nov 2025 14:11:26 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/Mod/CAM/Path/Post/scripts/KineticNCBeamicon2_post.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Mod/CAM/Path/Post/scripts/KineticNCBeamicon2_post.py b/src/Mod/CAM/Path/Post/scripts/KineticNCBeamicon2_post.py index dc54985af4..0081080974 100644 --- a/src/Mod/CAM/Path/Post/scripts/KineticNCBeamicon2_post.py +++ b/src/Mod/CAM/Path/Post/scripts/KineticNCBeamicon2_post.py @@ -402,8 +402,12 @@ 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 ( + command in ["G0"] + and "Z" not in c.Parameters + and pathobj.Label == "Drilling" + and "R" in currLocation.keys() + ): if not OUTPUT_DOUBLES: continue else: