예제 #1
0
 def test_compute_3dedge_nointersection(self):
     point = [0.5, 0, -0.5]
     direction = [0, 0, -1]
     res = poly3d_intersection(self.cube, point, direction)
     self.assertEqual(len(res), 0)
예제 #2
0
 def test_slightly_complex_intersection(self):
     point = [0, 0, -0.5]
     direction = [1, 1, 1]
     res = poly3d_intersection(self.cube, point, direction)
     np.testing.assert_almost_equal(res[0], np.array([0.5, 0.5, 0.0]))
     np.testing.assert_almost_equal(res[1], np.array([1.0, 1.0, 0.5]))
예제 #3
0
 def test_slightly_complex_nointersection(self):
     point = [0, 0, -0.5]
     direction = [-1, -1, -1]
     res = poly3d_intersection(self.cube, point, direction)
     self.assertEqual(len(res), 0)
예제 #4
0
 def test_compute_3dedge_intersection(self):
     point = [0.5, 0, -0.5]
     direction = [0, 0, 1]
     res = poly3d_intersection(self.cube, point, direction)
     np.testing.assert_almost_equal(res[0], np.array([0.5, 0.0, 0.0]))
     np.testing.assert_almost_equal(res[1], np.array([0.5, 0.0, 1.0]))