[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.
This commit is contained in:
Gabriel Wicke
2019-10-06 16:46:55 -07:00
committed by Yorik van Havre
parent 95f18a7507
commit 5a055fec0d

View File

@@ -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)