Path: Add new Face Region boundary option.
New option allows access to previously inaccessible faces. Corrected property label names in UI panel, and added `Face Region` option to boundary shape list.
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<widget class="QLabel" name="toolController_label">
|
||||
<property name="text">
|
||||
<string>Tool Controller</string>
|
||||
</property>
|
||||
@@ -38,7 +38,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<widget class="QLabel" name="coolantController_label">
|
||||
<property name="text">
|
||||
<string>Coolant Mode</string>
|
||||
</property>
|
||||
@@ -64,12 +64,17 @@
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Perimeter</string>
|
||||
<string>Boundbox</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Boundbox</string>
|
||||
<string>Face Region</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Perimeter</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
@@ -80,7 +85,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_12">
|
||||
<widget class="QLabel" name="boundaryShape_label">
|
||||
<property name="text">
|
||||
<string>Boundary Shape</string>
|
||||
</property>
|
||||
@@ -96,7 +101,7 @@
|
||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<widget class="QLabel" name="cutMode_label">
|
||||
<property name="text">
|
||||
<string>Cut Mode</string>
|
||||
</property>
|
||||
@@ -120,7 +125,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<widget class="QLabel" name="offsetPattern_label">
|
||||
<property name="text">
|
||||
<string>Pattern</string>
|
||||
</property>
|
||||
@@ -172,7 +177,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<widget class="QLabel" name="zigZagAngle_label">
|
||||
<property name="text">
|
||||
<string>Angle</string>
|
||||
</property>
|
||||
@@ -186,7 +191,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<widget class="QLabel" name="stepOverPercent_label">
|
||||
<property name="text">
|
||||
<string>Step Over Percent</string>
|
||||
</property>
|
||||
@@ -212,7 +217,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="extraOffsetLabel">
|
||||
<widget class="QLabel" name="extraOffset_label">
|
||||
<property name="text">
|
||||
<string>Material Allowance</string>
|
||||
</property>
|
||||
@@ -226,7 +231,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<widget class="QLabel" name="enableRotation_label">
|
||||
<property name="text">
|
||||
<string>Enable Rotation</string>
|
||||
</property>
|
||||
|
||||
@@ -58,12 +58,12 @@ 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', 'Stock', 'Available']
|
||||
obj.addProperty("App::PropertyBool", "ClearEdges", "Face", QtCore.QT_TRANSLATE_NOOP("App::Property", "Clear edges of surface (Only applicable to BoundBox)"))
|
||||
|
||||
if not hasattr(obj, 'ExcludeRaisedAreas'):
|
||||
obj.addProperty("App::PropertyBool", "ExcludeRaisedAreas", "Face", QtCore.QT_TRANSLATE_NOOP("App::Property", "Exclude milling raised areas inside the face."))
|
||||
|
||||
obj.BoundaryShape = ['Boundbox', 'Face Region', 'Perimeter', 'Stock']
|
||||
|
||||
def pocketInvertExtraOffset(self):
|
||||
return True
|
||||
|
||||
@@ -190,13 +190,26 @@ class ObjectFace(PathPocketBase.ObjectPocket):
|
||||
env = PathUtils.getEnvelope(partshape=ofstShape, depthparams=self.depthparams)
|
||||
else:
|
||||
env = PathUtils.getEnvelope(partshape=planeshape, depthparams=self.depthparams)
|
||||
elif obj.BoundaryShape == 'Face Region':
|
||||
import PathScripts.PathSurfaceSupport as PathSurfaceSupport
|
||||
baseShape = oneBase[0].Shape
|
||||
psZMin = planeshape.BoundBox.ZMin
|
||||
ofstShape = PathSurfaceSupport.extractFaceOffset(planeshape, self.tool.Diameter * 1.1, planeshape)
|
||||
ofstShape.translate(FreeCAD.Vector(0.0, 0.0, psZMin - ofstShape.BoundBox.ZMin))
|
||||
# custDepthparams = self._customDepthParams(obj, obj.StartDepth.Value, obj.FinalDepth.Value) # only an envelope
|
||||
# ofstShapeEnv = PathUtils.getEnvelope(partshape=ofstShape, depthparams=self.depthparams)
|
||||
# ofstShapeEnv.translate(FreeCAD.Vector(0.0, 0.0, -0.5))
|
||||
custDepthparams = self._customDepthParams(obj, obj.StartDepth.Value + 0.1, obj.FinalDepth.Value - 0.1) # only an envelope
|
||||
ofstShapeEnv = PathUtils.getEnvelope(partshape=ofstShape, depthparams=custDepthparams)
|
||||
env = ofstShapeEnv.cut(baseShape)
|
||||
|
||||
if holeShape:
|
||||
PathLog.info("Processing holes...")
|
||||
PathLog.debug("Processing holes and face ...")
|
||||
holeEnv = PathUtils.getEnvelope(partshape=holeShape, depthparams=self.depthparams)
|
||||
newEnv = env.cut(holeEnv)
|
||||
tup = newEnv, False, 'pathMillFace', 0.0, 'X', obj.StartDepth.Value, obj.FinalDepth.Value
|
||||
else:
|
||||
PathLog.debug("Processing solid face ...")
|
||||
tup = env, False, 'pathMillFace', 0.0, 'X', obj.StartDepth.Value, obj.FinalDepth.Value
|
||||
return [tup]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user