Expose PocketLastStepOver property
Property can be useful to fine tune the last stepover for some shapes
This commit is contained in:
@@ -156,6 +156,7 @@ class ObjectOp(PathOp.ObjectOp):
|
||||
self.areaOpOnChanged(obj, prop)
|
||||
|
||||
def opOnDocumentRestored(self, obj):
|
||||
PathLog.track()
|
||||
for prop in ["AreaParams", "PathParams", "removalshape"]:
|
||||
if hasattr(obj, prop):
|
||||
obj.setEditorMode(prop, 2)
|
||||
@@ -419,6 +420,7 @@ class ObjectOp(PathOp.ObjectOp):
|
||||
FreeCAD.Console.PrintError(
|
||||
"Something unexpected happened. Check project and tool config."
|
||||
)
|
||||
raise e
|
||||
else:
|
||||
if profileEdgesIsOpen:
|
||||
ppCmds = pp
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# ***************************************************************************
|
||||
# * Copyright (c) 2017 sliptonic <shopinthewoods@gmail.com> *
|
||||
# * Copyright (c) 2020 russ4262 (Russell Johnson) *
|
||||
@@ -106,6 +105,9 @@ class ObjectPocket(PathAreaOp.ObjectOp):
|
||||
Can safely be overwritten by subclass."""
|
||||
pass
|
||||
|
||||
def areaOpSetDefaultValues(self, obj, job):
|
||||
obj.PocketLastStepOver = 0
|
||||
|
||||
def pocketInvertExtraOffset(self):
|
||||
"""pocketInvertExtraOffset() ... return True if ExtraOffset's direction is inward.
|
||||
Can safely be overwritten by subclass."""
|
||||
@@ -175,6 +177,15 @@ class ObjectPocket(PathAreaOp.ObjectOp):
|
||||
"App::Property", "Attempts to avoid unnecessary retractions."
|
||||
),
|
||||
)
|
||||
obj.addProperty(
|
||||
"App::PropertyPercent",
|
||||
"PocketLastStepOver",
|
||||
"Pocket",
|
||||
QT_TRANSLATE_NOOP(
|
||||
"App::Property",
|
||||
"Last Stepover Radius. If 0, 50% of cutter is used. Tuning this can be used to improve stepover for some shapes",
|
||||
),
|
||||
)
|
||||
|
||||
for n in self.pocketPropertyEnumerations():
|
||||
setattr(obj, n[0], n[1])
|
||||
@@ -191,6 +202,7 @@ class ObjectPocket(PathAreaOp.ObjectOp):
|
||||
|
||||
def areaOpAreaParams(self, obj, isHole):
|
||||
"""areaOpAreaParams(obj, isHole) ... return dictionary with pocket's area parameters"""
|
||||
PathLog.track()
|
||||
params = {}
|
||||
params["Fill"] = 0
|
||||
params["Coplanar"] = 0
|
||||
@@ -204,6 +216,7 @@ class ObjectPocket(PathAreaOp.ObjectOp):
|
||||
extraOffset = 0 - extraOffset
|
||||
params["PocketExtraOffset"] = extraOffset
|
||||
params["ToolRadius"] = self.radius
|
||||
params["PocketLastStepover"] = obj.PocketLastStepOver
|
||||
|
||||
Pattern = [
|
||||
"ZigZag",
|
||||
@@ -222,6 +235,20 @@ class ObjectPocket(PathAreaOp.ObjectOp):
|
||||
|
||||
return params
|
||||
|
||||
def opOnDocumentRestored(self, obj):
|
||||
if not hasattr(obj, "PocketLastStepover"):
|
||||
obj.addProperty(
|
||||
"App::PropertyPercent",
|
||||
"PocketLastStepOver",
|
||||
"Pocket",
|
||||
QT_TRANSLATE_NOOP(
|
||||
"App::Property",
|
||||
"Last Stepover Radius. If 0, 50% of cutter is used. Tuning this can be used to improve stepover for some shapes",
|
||||
),
|
||||
)
|
||||
obj.PocketLastStepOver = 0
|
||||
PathLog.track()
|
||||
|
||||
def areaOpPathParams(self, obj, isHole):
|
||||
"""areaOpAreaParams(obj, isHole) ... return dictionary with pocket's path parameters"""
|
||||
params = {}
|
||||
|
||||
Reference in New Issue
Block a user