Fixed tag marker display for path's not on z=0

This commit is contained in:
Markus Lampert
2017-11-20 21:26:06 -08:00
parent 85571ac9ad
commit d3f942cd63
2 changed files with 8 additions and 2 deletions

View File

@@ -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'):

View File

@@ -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)