Skip to content

Commit

Permalink
Make DressupAxisMap aware of start depth
Browse files Browse the repository at this point in the history
  • Loading branch information
troyp76 committed Sep 20, 2021
1 parent e5d5bc7 commit a7c0ff7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Mod/Path/PathScripts/PathDressupAxisMap.py
Expand Up @@ -137,7 +137,10 @@ def onChanged(self, obj, prop):
job.Proxy.setCenterOfRotation(self.center(obj))

def center(self, obj):
return FreeCAD.Vector(0, 0, 0 - obj.Radius.Value)
if obj.Base.StartDepth.Value > 0:
return FreeCAD.Vector(0, 0, 0)
else:
return FreeCAD.Vector(0, 0, 0 - obj.Radius.Value)


class TaskPanel:
Expand Down Expand Up @@ -276,7 +279,7 @@ def Activated(self):
FreeCADGui.doCommand('base = FreeCAD.ActiveDocument.' + selection[0].Name)
FreeCADGui.doCommand('job = PathScripts.PathUtils.findParentJob(base)')
FreeCADGui.doCommand('obj.Base = base')
FreeCADGui.doCommand('obj.Radius = 45')
FreeCADGui.doCommand('obj.Radius = (45, obj.Base.StartDepth)[obj.Base.StartDepth > 0]')
FreeCADGui.doCommand('job.Proxy.addOperation(obj, base)')
FreeCADGui.doCommand('obj.ViewObject.Proxy = PathScripts.PathDressupAxisMap.ViewProviderDressup(obj.ViewObject)')
FreeCADGui.doCommand('Gui.ActiveDocument.getObject(base.Name).Visibility = False')
Expand Down

0 comments on commit a7c0ff7

Please sign in to comment.