Allow selection of edges for engraving.

This commit is contained in:
Markus Lampert
2018-05-29 06:44:44 -07:00
committed by wmayer
parent 13bce09608
commit 60a49ede57

View File

@@ -45,16 +45,23 @@ class MESHGate:
class ENGRAVEGate:
def allow(self, doc, obj, sub):
engraveable = False
if hasattr(obj, "Shape"):
if obj.Shape.BoundBox.ZLength == 0.0:
try:
obj = obj.Shape
except:
return False
if len(obj.Wires) > 0:
engraveable = True
return engraveable
try:
shape = obj.Shape
except:
return False
if shape.BoundBox.ZLength == 0.0 and len(obj.Wires) > 0:
return True
if shape.ShapeType == 'Edge':
return True
if sub:
subShape = shape.getElement(sub)
if subShape.ShapeType == 'Edge':
return True
return False
class DRILLGate: