constraint: fix point position calculation
in PointsDistance, PointLineDistance, and PointsPlaneDistance Fixes #188
This commit is contained in:
parent
dab0eb5428
commit
4664316963
|
@ -1268,6 +1268,8 @@ class PointOnLine(Base):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def prepare(cls,obj,solver):
|
def prepare(cls,obj,solver):
|
||||||
|
if cls._measure:
|
||||||
|
return
|
||||||
func = cls.constraintFunc(obj,solver)
|
func = cls.constraintFunc(obj,solver)
|
||||||
if not func:
|
if not func:
|
||||||
return
|
return
|
||||||
|
@ -1303,7 +1305,7 @@ class PointsDistance(BaseCascade):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def init(cls,obj):
|
def init(cls,obj):
|
||||||
points = [ info.Placement.multVec(info.Shape.Vertex1.Point)
|
points = [ info.Placement.multVec(utils.getElementPos(info.Shape))
|
||||||
for info in obj.Proxy.getElementsInfo()[:2] ]
|
for info in obj.Proxy.getElementsInfo()[:2] ]
|
||||||
obj.Distance = points[0].distanceToPoint(points[1])
|
obj.Distance = points[0].distanceToPoint(points[1])
|
||||||
|
|
||||||
|
@ -1320,7 +1322,7 @@ class PointsPlaneDistance(BaseMulti):
|
||||||
@classmethod
|
@classmethod
|
||||||
def init(cls,obj):
|
def init(cls,obj):
|
||||||
infos = obj.Proxy.getElementsInfo()[:2]
|
infos = obj.Proxy.getElementsInfo()[:2]
|
||||||
points = [ info.Placement.multVec(info.Shape.Vertex1.Point)
|
points = [ info.Placement.multVec(utils.getElementPos(info.Shape))
|
||||||
for info in infos ]
|
for info in infos ]
|
||||||
rot = utils.getElementRotation(infos[1].Shape)
|
rot = utils.getElementRotation(infos[1].Shape)
|
||||||
axis = infos[1].Placement.Rotation.multVec(
|
axis = infos[1].Placement.Rotation.multVec(
|
||||||
|
@ -1338,7 +1340,7 @@ class PointLineDistance(PointOnLine):
|
||||||
@classmethod
|
@classmethod
|
||||||
def init(cls,obj):
|
def init(cls,obj):
|
||||||
infos = obj.Proxy.getElementsInfo()
|
infos = obj.Proxy.getElementsInfo()
|
||||||
p1 = infos[0].Placement.multVec(infos[0].Shape.Vertex1.Point)
|
p1 = infos[0].Placement.multVec(utils.getElementPos(infos[0].Shape))
|
||||||
p2 = infos[1].Placement.multVec(infos[1].Shape.Vertex1.Point)
|
p2 = infos[1].Placement.multVec(infos[1].Shape.Vertex1.Point)
|
||||||
p3 = infos[1].Placement.multVec(infos[1].Shape.Vertex2.Point)
|
p3 = infos[1].Placement.multVec(infos[1].Shape.Vertex2.Point)
|
||||||
if len(infos)==3:
|
if len(infos)==3:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user