fixed NearestToPointSelector failure with tuple as arguments
This commit is contained in:
parent
9e7cb277d2
commit
e39bf56cbe
|
@ -62,7 +62,7 @@ class NearestToPointSelector(Selector):
|
|||
def filter(self,objectList):
|
||||
|
||||
def dist(tShape):
|
||||
return tShape.Center().sub(self.pnt).Length
|
||||
return tShape.Center().sub(Vector(*self.pnt)).Length
|
||||
#if tShape.ShapeType == 'Vertex':
|
||||
# return tShape.Point.sub(toVector(self.pnt)).Length
|
||||
#else:
|
||||
|
|
|
@ -163,12 +163,12 @@ class TestCQSelectors(BaseTest):
|
|||
c = CQ(makeUnitCube())
|
||||
|
||||
#nearest vertex to origin is (0,0,0)
|
||||
t = Vector(0.1,0.1,0.1)
|
||||
t = (0.1,0.1,0.1)
|
||||
|
||||
v = c.vertices(selectors.NearestToPointSelector(t)).vals()[0]
|
||||
self.assertTupleAlmostEquals((0.0,0.0,0.0),(v.X,v.Y,v.Z),3)
|
||||
|
||||
t = Vector(0.1,0.1,0.2)
|
||||
t = (0.1,0.1,0.2)
|
||||
#nearest edge is the vertical side edge, 0,0,0 -> 0,0,1
|
||||
e = c.edges(selectors.NearestToPointSelector(t)).vals()[0]
|
||||
v = c.edges(selectors.NearestToPointSelector(t)).vertices().vals()
|
||||
|
|
Loading…
Reference in New Issue
Block a user