From e4b03f69f078b7e092a0b725f33d85c32cf27ca1 Mon Sep 17 00:00:00 2001 From: Sebastian Ohl Date: Mon, 3 Nov 2025 14:45:12 +0100 Subject: [PATCH] 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"