From d3f942cd63cdf08c6a265ef0b5c9304843c02352 Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Mon, 20 Nov 2017 21:26:06 -0800 Subject: [PATCH] Fixed tag marker display for path's not on z=0 --- src/Mod/Path/PathScripts/PathDressupHoldingTags.py | 8 +++++++- src/Mod/Path/PathScripts/PathDressupTagGui.py | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathDressupHoldingTags.py b/src/Mod/Path/PathScripts/PathDressupHoldingTags.py index 0885a3fa08..f2eec69892 100644 --- a/src/Mod/Path/PathScripts/PathDressupHoldingTags.py +++ b/src/Mod/Path/PathScripts/PathDressupHoldingTags.py @@ -651,7 +651,7 @@ class PathData: return ordered def pointIsOnPath(self, p): - v = Part.Vertex(FreeCAD.Vector(p.x, p.y, self.minZ)) + v = Part.Vertex(self.pointAtBottom(p)) PathLog.debug("pt = (%f, %f, %f)" % (v.X, v.Y, v.Z)) for e in self.bottomEdges: indent = "{} ".format(e.distToShape(v)[0]) @@ -660,6 +660,8 @@ class PathData: return True return False + def pointAtBottom(self, p): + return FreeCAD.Vector(p.x, p.y, self.minZ) class ObjectTagDressup: @@ -958,6 +960,10 @@ class ObjectTagDressup: self.setup(obj) return self.pathData.pointIsOnPath(point) + def pointAtBottom(self, obj, point): + if not hasattr(self, 'pathData'): + self.setup(obj) + return self.pathData.pointAtBottom(point) def Create(baseObject, name = 'DressupTag'): diff --git a/src/Mod/Path/PathScripts/PathDressupTagGui.py b/src/Mod/Path/PathScripts/PathDressupTagGui.py index 1dc8005163..f25b55c87d 100644 --- a/src/Mod/Path/PathScripts/PathDressupTagGui.py +++ b/src/Mod/Path/PathScripts/PathDressupTagGui.py @@ -419,7 +419,7 @@ class PathDressupTagViewProvider: self.switch.removeChild(tag.sep) tags = [] for i, p in enumerate(positions): - tag = HoldingTagMarker(p, self.colors) + tag = HoldingTagMarker(self.obj.Proxy.pointAtBottom(self.obj, p), self.colors) tag.setEnabled(not i in disabled) tags.append(tag) self.switch.addChild(tag.sep)