diff --git a/src/Mod/Path/PathScripts/PathProfileEdges.py b/src/Mod/Path/PathScripts/PathProfileEdges.py index 5b92499aa2..ea1e3f8240 100644 --- a/src/Mod/Path/PathScripts/PathProfileEdges.py +++ b/src/Mod/Path/PathScripts/PathProfileEdges.py @@ -88,6 +88,10 @@ class ObjectProfile: obj.addProperty("App::PropertyBool", "UseComp", "Profile", QtCore.QT_TRANSLATE_NOOP("App::Property", "make True, if using Cutter Radius Compensation")) obj.addProperty("App::PropertyDistance", "OffsetExtra", "Profile", QtCore.QT_TRANSLATE_NOOP("App::Property", "Extra value to stay away from final profile- good for roughing toolpath")) + obj.addProperty("App::PropertyEnumeration", "JoinType", "Contour", QtCore.QT_TRANSLATE_NOOP("App::Property", "Controls how tool moves around corners. Default=Round")) + obj.JoinType = ['Round', 'Square', 'Miter'] # this is the direction that the Contour runs + obj.addProperty("App::PropertyFloat", "MiterLimit", "Profile", QtCore.QT_TRANSLATE_NOOP("App::Property", "Maximum distance before a miter join is truncated")) + # Debug Parameters obj.addProperty("App::PropertyString", "AreaParams", "Path") @@ -117,6 +121,11 @@ class ObjectProfile: if prop in ['AreaParams', 'PathParams', 'removalshape']: obj.setEditorMode(prop, 2) + obj.setEditorMode('MiterLimit', 2) + if obj.JoinType == 'Miter': + obj.setEditorMode('MiterLimit', 0) + + def addprofilebase(self, obj, ss, sub=""): baselist = obj.Base if len(baselist) == 0: # When adding the first base object, guess at heights @@ -168,6 +177,12 @@ class ObjectProfile: else: profileparams['Offset'] = self.radius+obj.OffsetExtra.Value + jointype = ['Round', 'Square', 'Miter'] + profileparams['JoinType'] = jointype.index(obj.JoinType) + + if obj.JoinType == 'Miter': + profileparams['MiterLimit'] = obj.MiterLimit + profile.setParams(**profileparams) obj.AreaParams = str(profile.getParams())