From 0b82126a0e56724c0731b8f185c987e0a7711858 Mon Sep 17 00:00:00 2001 From: Sebastian Ohl Date: Mon, 3 Nov 2025 14:45:12 +0100 Subject: [PATCH 1/2] adding cooling feature to Kinetic post processor --- .../Post/scripts/KineticNCBeamicon2_post.py | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/Mod/CAM/Path/Post/scripts/KineticNCBeamicon2_post.py b/src/Mod/CAM/Path/Post/scripts/KineticNCBeamicon2_post.py index 4e65a33532..8e9099ffae 100644 --- a/src/Mod/CAM/Path/Post/scripts/KineticNCBeamicon2_post.py +++ b/src/Mod/CAM/Path/Post/scripts/KineticNCBeamicon2_post.py @@ -36,6 +36,7 @@ import FreeCAD from FreeCAD import Units import Path +import Path.Base.Util as PathUtil import Path.Post.Utils as PostUtils import argparse import datetime @@ -114,7 +115,6 @@ PRECISION = 3 # Preamble text will appear at the beginning of the GCODE output file. PREAMBLE = """% G17 G21 G40 G49 G80 G90 -M08 """ # Postamble text will appear following the last operation. @@ -214,6 +214,9 @@ def export(objectslist, filename, argstring): gcode += linenumber() + UNITS + "\n" for obj in objectslist: + # Skip inactive operations + if not PathUtil.activeForOp(obj): + continue # fetch machine details job = PathUtils.findParentJob(obj) @@ -243,6 +246,19 @@ def export(objectslist, filename, argstring): for line in PRE_OPERATION.splitlines(True): gcode += linenumber() + line + # get coolant mode + coolantMode = PathUtil.coolantModeForOp(obj) + + # turn coolant on if required + if OUTPUT_COMMENTS: + if not coolantMode == "None": + gcode += linenumber() + "(Coolant On:" + coolantMode + ")\n" + if coolantMode == "Flood": + gcode += linenumber() + "M8" + "\n" + if coolantMode == "Mist": + gcode += linenumber() + "M7" + "\n" + + # process the operation gcode gcode += parse(obj) # do the post_op @@ -251,6 +267,12 @@ def export(objectslist, filename, argstring): for line in POST_OPERATION.splitlines(True): gcode += linenumber() + line + # turn coolant off if required + if not coolantMode == "None": + if OUTPUT_COMMENTS: + gcode += linenumber() + "(Coolant Off:" + coolantMode + ")\n" + gcode += linenumber() + "M9" + "\n" + # do the post_amble if OUTPUT_COMMENTS: gcode += "(begin postamble)\n" From 773d018a19af5317348e63c1955483f4ee589d8b 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 13:53:15 +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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mod/CAM/Path/Post/scripts/KineticNCBeamicon2_post.py b/src/Mod/CAM/Path/Post/scripts/KineticNCBeamicon2_post.py index 8e9099ffae..42ebcdbed1 100644 --- a/src/Mod/CAM/Path/Post/scripts/KineticNCBeamicon2_post.py +++ b/src/Mod/CAM/Path/Post/scripts/KineticNCBeamicon2_post.py @@ -248,7 +248,7 @@ def export(objectslist, filename, argstring): # get coolant mode coolantMode = PathUtil.coolantModeForOp(obj) - + # turn coolant on if required if OUTPUT_COMMENTS: if not coolantMode == "None":