From 5a055fec0d2fa0f2ef2e6378c9c5c6c0d12de5bb Mon Sep 17 00:00:00 2001 From: Gabriel Wicke Date: Sun, 6 Oct 2019 16:46:55 -0700 Subject: [PATCH] [path] Fix ignoreWasteFlag option The code was trying to iterate over a `range(0, pntsPerLine)`, but pntsPerLine was a float resulting from a division. Convert pntsPerLine to an int, and only ignore waste if this was successful. --- src/Mod/Path/PathScripts/PathSurface.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathSurface.py b/src/Mod/Path/PathScripts/PathSurface.py index f1536bdd81..6dfcf5206c 100644 --- a/src/Mod/Path/PathScripts/PathSurface.py +++ b/src/Mod/Path/PathScripts/PathSurface.py @@ -117,7 +117,7 @@ class ObjectSurface(PathOp.ObjectOp): def opFeatures(self, obj): '''opFeatures(obj) ... return all standard features and edges based geomtries''' - return PathOp.FeatureTool | PathOp.FeatureDepths | PathOp.FeatureHeights | PathOp.FeatureStepDown | PathOp.FeatureCoolant + return PathOp.FeatureTool | PathOp.FeatureDepths | PathOp.FeatureHeights | PathOp.FeatureStepDown | PathOp.FeatureCoolant def initOperation(self, obj): '''initPocketOp(obj) ... create facing specific properties''' @@ -474,9 +474,11 @@ class ObjectSurface(PathOp.ObjectOp): # self.reportThis("--pntsPerLine: " + str(pntsPerLine)) if math.ceil(pntsPerLine) != math.floor(pntsPerLine): pntsPerLine = None + else: + pntsPerLine = math.ceil(pntsPerLine) # Create topo map for ignoring waste material - if ignoreWasteFlag is True: + if ignoreWasteFlag is True and pntsPerLine is not None: topoMap = createTopoMap(scanCLP, obj.IgnoreWasteDepth) self.topoMap = listToMultiDimensional(topoMap, numLines, pntsPerLine) self._bufferTopoMap(numLines, pntsPerLine)