Make sure we return intersection points even with zero distance from ray.
(self)
| 72 | assert np.allclose(points, ((-1.0, 0.0, 0.0), (1.0, 0.0, 0.0))) |
| 73 | |
| 74 | def test_intersection_when_on_surface(self): |
| 75 | """ Make sure we return intersection points even with zero distance from ray. |
| 76 | """ |
| 77 | a = Node(name="A", parent=None) |
| 78 | a.geometry = Sphere(radius=1.0) |
| 79 | loc = (-1.0, 0.0, 0.0) |
| 80 | vec = (1.0, 0.0, 0.0) |
| 81 | intersections = a.intersections(loc, vec) |
| 82 | points = np.array([x.point for x in intersections]) |
| 83 | expected = np.array([(-1.0, 0.0, 0.0), (1.0, 0.0, 0.0)]) |
| 84 | assert np.allclose(points, expected) |
| 85 | |
| 86 | def test_intersection_with_translation(self): |
| 87 | a = Node(name="A", parent=None) |
nothing calls this directly
no test coverage detected