PATH: post processor tweaks and loop select.

rename generic_post.py: This is actually a post specific to a machine.  The generic name is confusing
fix test case. Contour has no plunge angle
scrubbing postprocessors for python 2 style prints
Keep loop select usable when task panel is open.
This commit is contained in:
sliptonic
2017-01-19 11:16:44 -06:00
committed by wmayer
parent 81726f7db9
commit fbe0ded7cf
13 changed files with 543 additions and 529 deletions

View File

@@ -42,7 +42,8 @@ class _CommandSelectLoop:
def GetResources(self):
return {'Pixmap' : 'Path-SelectLoop',
'MenuText': QtCore.QT_TRANSLATE_NOOP("Path_SelectLoop","Finish Selecting Loop"),
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Path_SelectLoop","Complete loop selection from two edges")}
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Path_SelectLoop","Complete loop selection from two edges"),
'CmdType': "ForEdit"}
def IsActive(self):
if bool(FreeCADGui.Selection.getSelection()) is False:
@@ -77,29 +78,3 @@ class _CommandSelectLoop:
if FreeCAD.GuiUp:
FreeCADGui.addCommand('Path_SelectLoop',_CommandSelectLoop())
def findShape(shape,subname=None,subtype=None):
'''To find a higher oder shape containing the subshape with subname.
E.g. to find the wire containing 'Edge1' in shape,
findShape(shape,'Edge1','Wires')
'''
if not subname:
return shape
ret = shape.getElement(subname)
if not subtype or not ret or ret.isNull():
return ret;
if subname.startswith('Face'):
tp = 'Faces'
elif subname.startswith('Edge'):
tp = 'Edges'
elif subname.startswith('Vertex'):
tp = 'Vertex'
else:
return ret
for obj in getattr(shape,subtype):
for sobj in getattr(obj,tp):
if sobj.isEqual(ret):
return obj
return ret