From e03c37ee4b99527fa0b4edd547edbabc644a1f84 Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Tue, 26 Sep 2017 21:46:44 -0700 Subject: [PATCH] Added support for z-level selecction of circular shapes. --- src/Mod/Path/PathScripts/PathOpGui.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathOpGui.py b/src/Mod/Path/PathScripts/PathOpGui.py index 9cbffa8ded..e8312f0427 100644 --- a/src/Mod/Path/PathScripts/PathOpGui.py +++ b/src/Mod/Path/PathScripts/PathOpGui.py @@ -654,12 +654,13 @@ class TaskPanelDepthsPage(TaskPanelPage): def selectionZLevel(self, sel): if len(sel) == 1 and len(sel[0].SubObjects) == 1: sub = sel[0].SubObjects[0] - if 'Vertex' == sub.ShapeType: - return sub.Z - if 'Edge' == sub.ShapeType and PathGeom.isRoughly(sub.Vertexes[0].Z, sub.Vertexes[1].Z): - return sub.Vertexes[0].Z - if 'Face' == sub.ShapeType and PathGeom.isRoughly(sub.BoundBox.ZLength, 0): - return sub.BoundBox.ZMax + if PathGeom.isHorizontal(sub): + if 'Vertex' == sub.ShapeType: + return sub.Z + if 'Edge' == sub.ShapeType: + return sub.Vertexes[0].Z + if 'Face' == sub.ShapeType: + return sub.BoundBox.ZMax return None def updateSelection(self, obj, sel):