Merge pull request #4425 from sliptonic/feature/discreteArcs
[PATH] Add property to split arcs into G1/G0 segments
This commit is contained in:
@@ -88,6 +88,10 @@ class ObjectOp(PathOp.ObjectOp):
|
||||
obj.addProperty("Part::PropertyPartShape", "removalshape", "Path")
|
||||
obj.setEditorMode('removalshape', 2) # hide
|
||||
|
||||
obj.addProperty("App::PropertyBool", "SplitArcs", "Path", QtCore.QT_TRANSLATE_NOOP("App::Property", "Split Arcs into discrete segments"))
|
||||
|
||||
# obj.Proxy = self
|
||||
|
||||
self.initAreaOp(obj)
|
||||
|
||||
def initAreaOp(self, obj):
|
||||
@@ -140,6 +144,8 @@ class ObjectOp(PathOp.ObjectOp):
|
||||
for prop in ['AreaParams', 'PathParams', 'removalshape']:
|
||||
if hasattr(obj, prop):
|
||||
obj.setEditorMode(prop, 2)
|
||||
if not hasattr(obj, 'SplitArcs'):
|
||||
obj.addProperty("App::PropertyBool", "SplitArcs", "Path", QtCore.QT_TRANSLATE_NOOP("App::Property", "Split Arcs into discrete segments"))
|
||||
|
||||
self.areaOpOnDocumentRestored(obj)
|
||||
|
||||
|
||||
@@ -109,6 +109,11 @@ class ObjectPocket(PathAreaOp.ObjectOp):
|
||||
|
||||
Pattern = ['ZigZag', 'Offset', 'Spiral', 'ZigZagOffset', 'Line', 'Grid', 'Triangle']
|
||||
params['PocketMode'] = Pattern.index(obj.OffsetPattern) + 1
|
||||
|
||||
if obj.SplitArcs:
|
||||
params['Explode'] = True
|
||||
params['FitArcs'] = False
|
||||
|
||||
return params
|
||||
|
||||
def areaOpPathParams(self, obj, isHole):
|
||||
|
||||
@@ -331,6 +331,10 @@ class ObjectProfile(PathAreaOp.ObjectOp):
|
||||
if obj.JoinType == "Miter":
|
||||
params["MiterLimit"] = obj.MiterLimit
|
||||
|
||||
if obj.SplitArcs:
|
||||
params['Explode'] = True
|
||||
params['FitArcs'] = False
|
||||
|
||||
return params
|
||||
|
||||
def areaOpPathParams(self, obj, isHole):
|
||||
|
||||
Reference in New Issue
Block a user