From 6fdb672d3678c9b953440fd499218379878e9fe9 Mon Sep 17 00:00:00 2001 From: Dan Taylor Date: Tue, 6 May 2025 20:29:19 -0500 Subject: [PATCH] CAM: Fix adaptive repeating cuts excessively at various depths --- src/Mod/CAM/Path/Op/Adaptive.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Mod/CAM/Path/Op/Adaptive.py b/src/Mod/CAM/Path/Op/Adaptive.py index f1305b9cb9..2699c92a9e 100644 --- a/src/Mod/CAM/Path/Op/Adaptive.py +++ b/src/Mod/CAM/Path/Op/Adaptive.py @@ -1319,11 +1319,18 @@ def _getWorkingEdges(op, obj): rcut = stockProjectionDict[depths[0]] else: rcut = stockProjectionDict[depths[0]].cut(r["region"]) - parentdepths = depths[0:1] + + # If the region is already entirely within in the stock, there's no + # way the region can change at a lower depth. That rcut is not + # empty is an assumption for the check in the depth loop below + if not rcut.Wires: + continue + # If the region cut with the stock at a new depth is different than # the original cut, we need to split this region # The new region gets all of the children, and becomes a child of # the existing region. + parentdepths = depths[0:1] for d in depths[1:]: if ( areInsideRegions and r["region"].cut(stockProjectionDict[d]).cut(rcut).Wires