From 3b7f8dfccdc5d2060faa517174d0340e9b9c7fa7 Mon Sep 17 00:00:00 2001 From: "Zheng, Lei" Date: Thu, 14 Feb 2019 07:33:34 +0800 Subject: [PATCH] constraint: fix PointDistance Fixes #195 --- constraint.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/constraint.py b/constraint.py index f8b1c18..fe79d0b 100644 --- a/constraint.py +++ b/constraint.py @@ -1417,7 +1417,7 @@ class PointDistance(Base2): @classmethod def init(cls,obj): infos = obj.Proxy.getElementsInfo() - ps = [ info.Placement.multVec(info.Shape.Vertex1.Point) + ps = [ info.Placement.multVec(utils.getElementPos(info.Shape)) for info in infos ] if len(infos)==3: rot = infos[2].Placement.Rotation.multiply( @@ -1701,7 +1701,7 @@ class PointsProjectDistance(BaseSketch): @classmethod def init(cls,obj): infos = obj.Proxy.getElementsInfo() - ps = [ info.Placement.multVec(info.Shape.Vertex1.Point) + ps = [ info.Placement.multVec(utils.getElementPos(info.Shape)) for info in infos ] p3 = infos[2].Placement.multVec(infos[2].Shape.Vertex2.Point) p1,p2 = [ utils.projectToLine(p,ps[2],p3) for p in ps[:2] ]