def get_nearest_point(self, points):
"""
If there are more then 1 intersection points then use the nearest one to
be the intersection Point.
@param points: A list of points to be checked for nearest
@return: Returns the nearest Point
"""
if len(points) == 1:
Point = points[0]
else:
mindis = points[0].distance(self)
Point = points[0]
for i in range(1, len(points)):
curdis = points[i].distance(self)
if curdis < mindis:
mindis = curdis
Point = points[i]
return Point
评论列表
文章目录