From 8c70c3abcd1403d5a586bb11efdd69ad900cec70 Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Sat, 19 Aug 2017 12:26:19 -0700 Subject: [PATCH] Fixed retraction of tool when profiling multiple holes. --- src/Mod/Path/PathScripts/PathAreaOp.py | 13 ++++++++++--- src/Mod/Path/PathScripts/PathOp.py | 2 +- src/Mod/Path/PathScripts/PathProfileFaces.py | 3 ++- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathAreaOp.py b/src/Mod/Path/PathScripts/PathAreaOp.py index 496b3e43d1..226da5a373 100644 --- a/src/Mod/Path/PathScripts/PathAreaOp.py +++ b/src/Mod/Path/PathScripts/PathAreaOp.py @@ -218,7 +218,7 @@ class ObjectOp(PathOp.ObjectOp): if self.endVector is not None: pathParams['start'] = self.endVector - elif obj.UseStartPoint: + elif PathOp.FeatureStartPoint & self.opFeatures(obj) and obj.UseStartPoint: pathParams['start'] = obj.StartPoint obj.PathParams = str({key: value for key, value in pathParams.items() if key != 'shapes'}) @@ -259,10 +259,10 @@ class ObjectOp(PathOp.ObjectOp): final_depth=obj.FinalDepth.Value, user_depths=None) - if PathOp.FeatureStartPoint and obj.UseStartPoint: + if PathOp.FeatureStartPoint & self.opFeatures(obj) and obj.UseStartPoint: start = obj.StartPoint else: - start = FreeCAD.Vector() + start = None shapes = self.areaOpShapes(obj) @@ -276,8 +276,15 @@ class ObjectOp(PathOp.ObjectOp): FreeCAD.Console.PrintError(e) FreeCAD.Console.PrintError("Something unexpected happened. Check project and tool config.") + if self.areaOpRetractTool(obj): + self.endVector = None + return sims + def areaOpRetractTool(self, obj): + '''areaOpRetractTool(obj) ... return False to keep the tool at current level between shapes. Default is True.''' + return True + def areaOpAreaParams(self, obj, isHole): '''areaOpAreaParams(obj, isHole) ... return operation specific area parameters in a dictionary. Note that the resulting parameters are stored in the property AreaParams. diff --git a/src/Mod/Path/PathScripts/PathOp.py b/src/Mod/Path/PathScripts/PathOp.py index 5235807fe4..aab3f1aceb 100644 --- a/src/Mod/Path/PathScripts/PathOp.py +++ b/src/Mod/Path/PathScripts/PathOp.py @@ -214,7 +214,7 @@ class ObjectOp(object): self.commandlist ... a list for collecting all commands produced by the operation Once everything is validated and above variables are set the implementation calls - opExectue(obj) - which is expected to add the generated commands to self.commandlist + opExecute(obj) - which is expected to add the generated commands to self.commandlist Finally the base implementation adds a rapid move to clearance height and assigns the receiver's Path property from the command list. ''' diff --git a/src/Mod/Path/PathScripts/PathProfileFaces.py b/src/Mod/Path/PathScripts/PathProfileFaces.py index 6fa8d24493..8795bd9830 100644 --- a/src/Mod/Path/PathScripts/PathProfileFaces.py +++ b/src/Mod/Path/PathScripts/PathProfileFaces.py @@ -60,7 +60,7 @@ class ObjectProfile(PathProfileBase.ObjectProfile): def areaOpFeatures(self, obj): '''baseObject() ... returns super of receiver Used to call base implementation in overwritten functions.''' - return PathOp.FeatureBaseFaces + return PathOp.FeatureBaseFaces | PathOp.FeatureBasePanels def initAreaOp(self, obj): '''initAreaOp(obj) ... adds properties for hole, circle and perimeter processing.''' @@ -127,6 +127,7 @@ class ObjectProfile(PathProfileBase.ObjectProfile): env = PathUtils.getEnvelope(self.baseobject.Shape, subshape=f, depthparams=self.depthparams) shapes.append((env, False)) + PathLog.debug("%d shapes" % len(shapes)) return shapes def areaOpSetDefaultValues(self, obj):