Path: minor fixes to PathMillFace

This commit is contained in:
sliptonic
2017-05-13 10:47:10 -05:00
committed by wmayer
parent 6bd6cc0526
commit 4c5c439963
3 changed files with 33 additions and 32 deletions

View File

@@ -33,8 +33,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>500</width>
<height>282</height>
<width>285</width>
<height>277</height>
</rect>
</property>
<attribute name="icon">
@@ -111,8 +111,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>500</width>
<height>241</height>
<width>125</width>
<height>124</height>
</rect>
</property>
<attribute name="icon">
@@ -192,8 +192,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>500</width>
<height>241</height>
<width>154</width>
<height>68</height>
</rect>
</property>
<attribute name="icon">
@@ -241,9 +241,9 @@
<property name="geometry">
<rect>
<x>0</x>
<y>-34</y>
<width>486</width>
<height>361</height>
<y>0</y>
<width>500</width>
<height>329</height>
</rect>
</property>
<attribute name="icon">
@@ -271,7 +271,7 @@
</widget>
</item>
<item row="0" column="2">
<widget class="Gui::QuantitySpinBox" name="zigZagAngle" native="true">
<widget class="Gui::QuantitySpinBox" name="zigZagAngle">
<property name="unit" stdset="0">
<string notr="true"/>
</property>
@@ -422,6 +422,21 @@
<string>ZigZagOffset</string>
</property>
</item>
<item>
<property name="text">
<string>Line</string>
</property>
</item>
<item>
<property name="text">
<string>Grid</string>
</property>
</item>
<item>
<property name="text">
<string>Triangle</string>
</property>
</item>
</widget>
</item>
<item row="2" column="0">

View File

@@ -87,7 +87,7 @@ class ObjectFace:
obj.addProperty("App::PropertyEnumeration", "BoundaryShape", "Face", QtCore.QT_TRANSLATE_NOOP("App::Property", "Shape to use for calculating Boundary"))
obj.BoundaryShape = ['Perimeter', 'Boundbox']
obj.addProperty("App::PropertyEnumeration", "OffsetPattern", "Face", QtCore.QT_TRANSLATE_NOOP("App::Property", "clearing pattern to use"))
obj.OffsetPattern = ['Offset', 'ZigZag', 'Spiral', 'ZigZagOffset']
obj.OffsetPattern = ['ZigZag', 'Offset', 'Spiral', 'ZigZagOffset', 'Line', 'Grid', 'Triangle']
# Start Point Properties
obj.addProperty("App::PropertyVector", "StartPoint", "Start Point", QtCore.QT_TRANSLATE_NOOP("App::Property", "The start point of this path"))
@@ -173,13 +173,16 @@ class ObjectFace:
pocketparams = {'Fill': 0,
'Coplanar': 0,
'PocketMode': 4,
'PocketMode': 1,
'SectionCount': -1,
'Angle': obj.ZigZagAngle,
'FromCenter': (obj.StartAt == "Center"),
'PocketStepover': stepover,
'PocketExtraOffset': obj.PassExtension.Value}
Pattern = ['ZigZag', 'Offset', 'Spiral', 'ZigZagOffset', 'Line', 'Grid', 'Triangle']
pocketparams['PocketMode'] = Pattern.index(obj.OffsetPattern) + 1
depthparams = depth_params(
clearance_height=obj.ClearanceHeight.Value,
rapid_safety_space=obj.SafeHeight.Value,
@@ -200,6 +203,7 @@ class ObjectFace:
'resume_height': obj.StepDown,
'retraction': obj.ClearanceHeight.Value}
# if obj.Direction == 'CCW':
# params['orientation'] = 1
# else:
@@ -267,9 +271,9 @@ class ObjectFace:
if obj.BoundaryShape == 'Boundbox':
bb = planeshape.BoundBox
bbperim = Part.makeBox(bb.XLength, bb.YLength, 1, Vector(bb.XMin, bb.YMin, bb.ZMin), Vector(0, 0, 1))
env = PathUtils.getEnvelopeTD(bbperim, obj.StartDepth)
env = PathUtils.getEnvelope(bbperim, obj.StartDepth)
else:
env = PathUtils.getEnvelopeTD(planeshape, obj.StartDepth)
env = PathUtils.getEnvelope(planeshape, obj.StartDepth)
try:
commandlist.extend(self._buildPathArea(obj, env).Commands)

View File

@@ -237,24 +237,6 @@ def getEnvelope(partshape, stockheight=None):
return sec.extrude(FreeCAD.Vector(0, 0, partshape.BoundBox.ZMax))
def getEnvelopeTD(partshape, stockheight=None):
'''
getEnvelopTD(partshape, stockheight=None)
Uses the TechDraw findShapeOutline to return a shape corresponding to the
partshape silhouette extruded to height. if stockheight is given, the
returned shape is extruded to that height otherwise the returned shape
is the height of the original shape boundbox
partshape = solid object
stockheight = float
'''
import TechDraw
sec = Part.Face(TechDraw.findShapeOutline(partshape, 1, FreeCAD.Vector(0, 0, 1)))
if stockheight is not None:
return sec.extrude(FreeCAD.Vector(0, 0, stockheight))
else:
return sec.extrude(FreeCAD.Vector(0, 0, partshape.BoundBox.ZMax))
def reverseEdge(e):
if geomType(e) == "Circle":
arcstpt = e.valueAt(e.FirstParameter)