Path: Fix paths through model

All cut patterns except Offset were cutting through model.
This commit is contained in:
Russell Johnson
2020-06-03 01:14:26 -05:00
parent bebdf2d006
commit 1d35573917
2 changed files with 14 additions and 12 deletions

View File

@@ -91,12 +91,11 @@ class PathGeometryGenerator:
if shape.BoundBox.ZMin != 0.0:
shape.translate(FreeCAD.Vector(0.0, 0.0, 0.0 - shape.BoundBox.ZMin))
if shape.BoundBox.ZLength == 0.0:
self.shape = shape
else:
if shape.BoundBox.ZLength > 1.0e-8:
FreeCAD.Console.PrintWarning('Shape appears to not be horizontal planar. ZMax is {}.\n'.format(shape.BoundBox.ZMax))
self._prepareConstants()
else:
self.shape = shape
self._prepareConstants()
def _prepareConstants(self):
# Apply drop cutter extra offset and set the max and min XY area of the operation

View File

@@ -1281,14 +1281,17 @@ class ObjectWaterline(PathOp.ObjectOp):
if cont:
# Identify solid areas in the offset data
ofstSolidFacesList = self._getSolidAreasFromPlanarFaces(ofstArea)
if ofstSolidFacesList:
clearArea = Part.makeCompound(ofstSolidFacesList)
self.showDebugObject(clearArea, 'ClearArea_{}'.format(caCnt))
if obj.CutPattern == 'Offset' or obj.CutPattern == 'None':
ofstSolidFacesList = self._getSolidAreasFromPlanarFaces(ofstArea)
if ofstSolidFacesList:
clearArea = Part.makeCompound(ofstSolidFacesList)
self.showDebugObject(clearArea, 'ClearArea_{}'.format(caCnt))
else:
cont = False
data = FreeCAD.Units.Quantity(csHght, FreeCAD.Units.Length).UserString
PathLog.error('Could not determine solid faces at {}.'.format(data))
else:
cont = False
data = FreeCAD.Units.Quantity(csHght, FreeCAD.Units.Length).UserString
PathLog.error('Could not determine solid faces at {}.'.format(data))
clearArea = activeArea
if cont:
# Make waterline path for current CUTAREA depth (csHght)