def test_duplicates(self):
# After three subdivisions, there are 8 pairs of curve segments
# which have bounding boxes that touch at corners (these corners are
# also intersections). This test makes sure the duplicates are
# de-duplicated.
nodes1 = np.asfortranarray([
[0.0, 0.0],
[0.5, 1.0],
[1.0, 0.0],
])
nodes2 = np.asfortranarray([
[0.0, 0.75],
[0.5, -0.25],
[1.0, 0.75],
])
intersections = self._call_function_under_test(nodes1, nodes2)
expected = np.asfortranarray([
[0.25, 0.25],
[0.75, 0.75],
])
self.assertEqual(intersections, expected)
评论列表
文章目录