From 60a49ede573e8f7255a9949ce9757d2fa831fd94 Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Tue, 29 May 2018 06:44:44 -0700 Subject: [PATCH] Allow selection of edges for engraving. --- src/Mod/Path/PathScripts/PathSelection.py | 27 ++++++++++++++--------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathSelection.py b/src/Mod/Path/PathScripts/PathSelection.py index 867a44fc1e..1abfb5015d 100644 --- a/src/Mod/Path/PathScripts/PathSelection.py +++ b/src/Mod/Path/PathScripts/PathSelection.py @@ -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: