diff --git a/src/Mod/Path/PathScripts/PathProfile.py b/src/Mod/Path/PathScripts/PathProfile.py index 595a3fb0a1..02e10b3fc2 100644 --- a/src/Mod/Path/PathScripts/PathProfile.py +++ b/src/Mod/Path/PathScripts/PathProfile.py @@ -482,12 +482,7 @@ class ObjectProfile(PathAreaOp.ObjectOp): for shape in faces: finalDep = obj.FinalDepth.Value custDepthparams = self.depthparams - - if obj.Side == 'Inside': - if finalDep < shape.BoundBox.ZMin: - # Recalculate depthparams - finalDep = shape.BoundBox.ZMin - custDepthparams = self._customDepthParams(obj, strDep + 0.5, finalDep) + self._addDebugObject('Rotation_Indiv_Shp', shape) if self.expandProfile: shapeEnv = self._getExpandedProfileEnvelope(obj, shape, False, obj.StartDepth.Value, finalDep) @@ -557,13 +552,16 @@ class ObjectProfile(PathAreaOp.ObjectOp): (norm, surf) = self.getFaceNormAndSurf(shape) (rtn, angle, axis, praInfo) = self.faceRotationAnalysis(obj, norm, surf) # pylint: disable=unused-variable PathLog.debug("initial faceRotationAnalysis: {}".format(praInfo)) + if rtn is True: + # Rotational alignment is suggested from analysis (clnBase, angle, clnStock, tag) = self.applyRotationalAnalysis(obj, base, angle, axis, subCount) # Verify faces are correctly oriented - InverseAngle might be necessary faceIA = getattr(clnBase.Shape, sub) (norm, surf) = self.getFaceNormAndSurf(faceIA) (rtn, praAngle, praAxis, praInfo2) = self.faceRotationAnalysis(obj, norm, surf) # pylint: disable=unused-variable PathLog.debug("follow-up faceRotationAnalysis: {}".format(praInfo2)) + PathLog.debug("praAngle: {}".format(praAngle)) if abs(praAngle) == 180.0: rtn = False @@ -572,9 +570,13 @@ class ObjectProfile(PathAreaOp.ObjectOp): angle -= 180.0 if rtn is True: - PathLog.debug(translate("Path", "Face appears misaligned after initial rotation.")) - if obj.InverseAngle is False: - if obj.AttemptInverseAngle is True: + PathLog.debug(translate("Path", "Face appears misaligned after initial rotation.")) + if obj.AttemptInverseAngle is True: + PathLog.debug(translate("Path", "Applying inverse angle automatically.")) + (clnBase, clnStock, angle) = self.applyInverseAngle(obj, clnBase, clnStock, axis, angle) + else: + if obj.InverseAngle: + PathLog.debug(translate("Path", "Applying inverse angle manually.")) (clnBase, clnStock, angle) = self.applyInverseAngle(obj, clnBase, clnStock, axis, angle) else: msg = translate("Path", "Consider toggling the 'InverseAngle' property and recomputing.")