def test_ray_from_below(): p = Plane() r = Ray(Point(0, -1, 0), Vector(0, 1, 0)) xs = p.local_intersect(r) assert len(xs) == 1 assert xs[0].t == 1 assert xs[0].object == p
def test_intersect_from_above(self): p = Plane() r = Ray(Point(0, -1, 0), Vector(0, 1, 0)) xs = p.local_intersect(r) self.assertEqual(len(xs), 1) self.assertEqual(xs[0].t, 1) self.assertEqual(xs[0].object, p)
def test_coplanar_ray(): p = Plane() r = Ray(Point(0, 0, 0), Vector(0, 0, 1)) xs = p.local_intersect(r) assert len(xs) == 0
def test_intersect_with_coplanar(self): p = Plane() r = Ray(Point(0, 0, 0), Vector(0, 0, 1)) xs = p.local_intersect(r) self.assertEqual(len(xs), 0)