Exemplo n.º 1
0
 def test_positions_flat_plane_no_plane_normal(self):
     plane_point = np.array([0, 0, 0])
     with self.assertRaises(ValueError):
         bundles.get_plane_positions(
             self.positions,
             self.directions,
             plane_point,
         )
Exemplo n.º 2
0
 def test_positions_angled_plane_2(self):
     result = bundles.get_plane_positions(
         positions=np.array([[-1, 0, 1]]),
         directions=np.array([[1, 0, -1]]),
         plane_point=np.array([0, 0, 0]),
         plane_normal=np.array([-1, 0, 1]),
     )
     np.testing.assert_array_equal(result, np.array([[0, 0]]))
Exemplo n.º 3
0
 def test_positions_angled_plane(self):
     plane_point = np.array([0, 0, 0])
     plane_normal = np.array([1, 0, 1])
     result = bundles.get_plane_positions(
         self.positions,
         self.directions,
         plane_point,
         plane_normal,
     )
     target = np.array([
         [0, 0],
         [0, 0],
         [np.sqrt(50), 3],
         [0, 2],
     ])
     np.testing.assert_array_equal(result, target)