Skip to content

Commit

Permalink
Fixed Contour.Direction and simplified Dogbone.Side determination.
Browse files Browse the repository at this point in the history
  • Loading branch information
mlampert authored and yorikvanhavre committed Jul 10, 2017
1 parent 1bda016 commit 104eb53
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/Mod/Path/PathScripts/PathContour.py
Expand Up @@ -181,9 +181,9 @@ def _buildPathArea(self, obj, baseobject, start=None, getsim=False):
'return_end': True}

if obj.Direction == 'CCW':
params['orientation'] = 1
else:
params['orientation'] = 0
else:
params['orientation'] = 1

if self.endVector is not None:
params['start'] = self.endVector
Expand Down
23 changes: 8 additions & 15 deletions src/Mod/Path/PathScripts/PathDressupDogbone.py
Expand Up @@ -37,7 +37,7 @@
"""Dogbone Dressup object and FreeCAD command"""

LOG_MODULE = PathLog.thisModule()
PathLog.setLevel(PathLog.Level.INFO, LOG_MODULE)
#PathLog.setLevel(PathLog.Level.INFO, LOG_MODULE)

# Qt tanslation handling
def translate(context, text, disambig=None):
Expand Down Expand Up @@ -774,27 +774,20 @@ def execute(self, obj):
path = Path.Path(commands)
obj.Path = path

def setup(self, obj, initial = False):
def setup(self, obj, initial):
PathLog.info("Here we go ... ")
if initial:
if hasattr(obj.Base, "BoneBlacklist"):
# dressing up a bone dressup
obj.Side = obj.Base.Side
else:
# otherwise dogbones are opposite of the base path's side
if hasattr(obj.Base, 'Side'):
if obj.Base.Side == Side.Left:
obj.Side = Side.Right
elif obj.Base.Side == Side.Right:
obj.Side = Side.Left
else:
# This will cause an error, which is fine for now 'cause I don't know what to do here
obj.Side = 'On'
else:
if obj.Base.Direction == 'CW':
obj.Side = Side.Left
else:
obj.Side = Side.Right
side = Side.Right
if hasattr(obj.Base, 'Side') and obj.Base.Side == 'Inside':
side = Side.Left
if obj.Base.Direction == 'CCW':
side = Side.oppositeOf(side)
obj.Side = side

self.toolRadius = 5
toolLoad = obj.ToolController
Expand Down

0 comments on commit 104eb53

Please sign in to comment.