From 1800ef0f108ffcdf5be4bd06c24a1b4d3e2ae6aa Mon Sep 17 00:00:00 2001 From: Dimitris75 <30848292+Dimitris75@users.noreply.github.com> Date: Tue, 20 Jan 2026 04:35:32 +0200 Subject: [PATCH] CAM Waterline OCL Adaptive Add - Optimize Linear Paths Remove - Unecessary BoundBox selection --- src/Mod/CAM/Path/Op/Gui/Waterline.py | 9 +++++++++ src/Mod/CAM/Path/Op/Waterline.py | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/src/Mod/CAM/Path/Op/Gui/Waterline.py b/src/Mod/CAM/Path/Op/Gui/Waterline.py index 29f1ec48c7..d4dee64d9b 100644 --- a/src/Mod/CAM/Path/Op/Gui/Waterline.py +++ b/src/Mod/CAM/Path/Op/Gui/Waterline.py @@ -146,6 +146,8 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage): self.form.optimizeEnabled.hide() # Has no independent QLabel object if Algorithm == "OCL Dropcutter": + self.form.boundBoxSelect.show() + self.form.boundBoxSelect_label.show() self.form.cutPattern.hide() self.form.cutPattern_label.hide() self.form.boundaryAdjustment.hide() @@ -156,7 +158,10 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage): self.form.minSampleInterval_label.hide() self.form.sampleInterval.show() self.form.sampleInterval_label.show() + self.form.optimizeEnabled.hide() elif Algorithm == "OCL Adaptive": + self.form.boundBoxSelect.hide() + self.form.boundBoxSelect_label.hide() self.form.cutPattern.hide() self.form.cutPattern_label.hide() self.form.boundaryAdjustment.hide() @@ -167,7 +172,10 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage): self.form.minSampleInterval_label.show() self.form.sampleInterval.show() self.form.sampleInterval_label.show() + self.form.optimizeEnabled.show() elif Algorithm == "Experimental": + self.form.boundBoxSelect.show() + self.form.boundBoxSelect_label.show() self.form.cutPattern.show() self.form.boundaryAdjustment.show() self.form.cutPattern_label.show() @@ -182,6 +190,7 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage): self.form.minSampleInterval_label.hide() self.form.sampleInterval.hide() self.form.sampleInterval_label.hide() + self.form.optimizeEnabled.hide() def registerSignalHandlers(self, obj): self.form.algorithmSelect.currentIndexChanged.connect(self.updateVisibility) diff --git a/src/Mod/CAM/Path/Op/Waterline.py b/src/Mod/CAM/Path/Op/Waterline.py index 1827206aad..8101fd6d3f 100644 --- a/src/Mod/CAM/Path/Op/Waterline.py +++ b/src/Mod/CAM/Path/Op/Waterline.py @@ -564,6 +564,7 @@ class ObjectWaterline(PathOp.ObjectOp): obj.setEditorMode("CutPattern", C) obj.setEditorMode("SampleInterval", G) obj.setEditorMode("MinSampleInterval", D) + obj.setEditorMode("OptimizeLinearPaths", D) obj.setEditorMode("LinearDeflection", expMode) obj.setEditorMode("AngularDeflection", expMode) @@ -1226,6 +1227,7 @@ class ObjectWaterline(PathOp.ObjectOp): bb = self.boundBoxes[mdlIdx] stl = self.modelSTLs[mdlIdx] depOfst = obj.DepthOffset.Value + optimizeLinear = obj.OptimizeLinearPaths # Prepare global holdpoint and layerEndPnt containers if self.holdPoint is None: @@ -1284,6 +1286,8 @@ class ObjectWaterline(PathOp.ObjectOp): # Generate G-Code layTime = time.time() for loop in scanLines: + if optimizeLinear: + loop = PathUtils.simplify3dLine(loop, tolerance=self.geoTlrnc) # We pass '0.0' as layDep because Adaptive loops have their own Z embedded cmds = self._loopToGcode(obj, 0.0, loop) commands.extend(cmds)