def intersect(self, other):
"""intersect self with other path
Returns a tuple of lists consisting of the parameter values
of the intersection points of the corresponding normpath.
"""
other = other.normpath()
# here we build up the result
intersections = ([], [])
# Intersect all normsubpaths of self with the normsubpaths of
# other.
for ia, normsubpath_a in enumerate(self.normsubpaths):
for ib, normsubpath_b in enumerate(other.normsubpaths):
for intersection in zip(*normsubpath_a.intersect(normsubpath_b)):
intersections[0].append(normpathparam(self, ia, intersection[0]))
intersections[1].append(normpathparam(other, ib, intersection[1]))
return intersections
评论列表
文章目录