From 1d35573917f4caaa720359a1c35181ada35ef46d Mon Sep 17 00:00:00 2001 From: Russell Johnson <47639332+Russ4262@users.noreply.github.com> Date: Wed, 3 Jun 2020 01:14:26 -0500 Subject: [PATCH] Path: Fix paths through model All cut patterns except Offset were cutting through model. --- src/Mod/Path/PathScripts/PathSurfaceSupport.py | 9 ++++----- src/Mod/Path/PathScripts/PathWaterline.py | 17 ++++++++++------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathSurfaceSupport.py b/src/Mod/Path/PathScripts/PathSurfaceSupport.py index 3ee6e70cec..5599eb4ac3 100644 --- a/src/Mod/Path/PathScripts/PathSurfaceSupport.py +++ b/src/Mod/Path/PathScripts/PathSurfaceSupport.py @@ -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 diff --git a/src/Mod/Path/PathScripts/PathWaterline.py b/src/Mod/Path/PathScripts/PathWaterline.py index 8492aa8491..0344350b59 100644 --- a/src/Mod/Path/PathScripts/PathWaterline.py +++ b/src/Mod/Path/PathScripts/PathWaterline.py @@ -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)