From 104eb53a8b838a086797fb1256ab9b01e6771a9b Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Sat, 8 Jul 2017 14:43:13 -0700 Subject: [PATCH] Fixed Contour.Direction and simplified Dogbone.Side determination. --- src/Mod/Path/PathScripts/PathContour.py | 4 ++-- .../Path/PathScripts/PathDressupDogbone.py | 23 +++++++------------ 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathContour.py b/src/Mod/Path/PathScripts/PathContour.py index 8426394574..c315b6202f 100644 --- a/src/Mod/Path/PathScripts/PathContour.py +++ b/src/Mod/Path/PathScripts/PathContour.py @@ -181,9 +181,9 @@ class ObjectContour: '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 diff --git a/src/Mod/Path/PathScripts/PathDressupDogbone.py b/src/Mod/Path/PathScripts/PathDressupDogbone.py index 19797d2217..21ea585e59 100644 --- a/src/Mod/Path/PathScripts/PathDressupDogbone.py +++ b/src/Mod/Path/PathScripts/PathDressupDogbone.py @@ -37,7 +37,7 @@ from PySide import QtCore, QtGui """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): @@ -774,7 +774,7 @@ class ObjectDressup: 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"): @@ -782,19 +782,12 @@ class ObjectDressup: 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