diff --git a/src/Mod/Path/Gui/Resources/panels/PageOpPocketFullEdit.ui b/src/Mod/Path/Gui/Resources/panels/PageOpPocketFullEdit.ui
index 01e1b8d7e7..7ab90c7ce8 100644
--- a/src/Mod/Path/Gui/Resources/panels/PageOpPocketFullEdit.ui
+++ b/src/Mod/Path/Gui/Resources/panels/PageOpPocketFullEdit.ui
@@ -65,6 +65,11 @@
Boundbox
+ -
+
+ Stock
+
+
diff --git a/src/Mod/Path/PathScripts/PathMillFace.py b/src/Mod/Path/PathScripts/PathMillFace.py
index 7b671bbb07..71d6188e87 100644
--- a/src/Mod/Path/PathScripts/PathMillFace.py
+++ b/src/Mod/Path/PathScripts/PathMillFace.py
@@ -56,7 +56,7 @@ class ObjectFace(PathPocketBase.ObjectPocket):
def initPocketOp(self, obj):
'''initPocketOp(obj) ... create facing specific properties'''
obj.addProperty("App::PropertyEnumeration", "BoundaryShape", "Face", QtCore.QT_TRANSLATE_NOOP("App::Property", "Shape to use for calculating Boundary"))
- obj.BoundaryShape = ['Perimeter', 'Boundbox']
+ obj.BoundaryShape = ['Perimeter', 'Boundbox', 'Stock']
def pocketInvertExtraOffset(self):
return True
@@ -73,7 +73,7 @@ class ObjectFace(PathPocketBase.ObjectPocket):
obj.OpStartDepth = job.Stock.Shape.BoundBox.ZMax
if len(obj.Base) >= 1:
- print ('processing')
+ print('processing')
sublist = []
for i in obj.Base:
o = i[0]
@@ -110,12 +110,15 @@ class ObjectFace(PathPocketBase.ObjectPocket):
planeshape = self.baseobject.Shape
PathLog.debug("Working on a shape {}".format(self.baseobject.Name))
- # if user wants the boundbox, calculate that
+ # Find the correct shape depending on Boundary shape.
PathLog.debug("Boundary Shape: {}".format(obj.BoundaryShape))
bb = planeshape.BoundBox
if obj.BoundaryShape == 'Boundbox':
bbperim = Part.makeBox(bb.XLength, bb.YLength, 1, FreeCAD.Vector(bb.XMin, bb.YMin, bb.ZMin), FreeCAD.Vector(0, 0, 1))
env = PathUtils.getEnvelope(partshape=bbperim, depthparams=self.depthparams)
+ elif obj.BoundaryShape == 'Stock':
+ stock = PathUtils.findParentJob(obj).Stock.Shape
+ env = stock
else:
env = PathUtils.getEnvelope(partshape=planeshape, depthparams=self.depthparams)