Exemplo n.º 1
0
 def test_find_closest_point_candidates_infinity(self):
     cs.init(3, {0:[0], 1:[1,2]})
     c1 = Cuboid([float("-inf"),2,3],[float("inf"),8,9], {1:[1,2]})
     c2 = Cuboid([float("-inf"),5,6],[float("inf"),9,7], {1:[1,2]})
     s = Core([c1, c2], {1:[1,2]})
     p = [12,-2,8]
     self.assertEqual(s.find_closest_point_candidates(p), [[12,2,8],[12,5,7]])   
Exemplo n.º 2
0
 def test_find_closest_point_candidates_two_cuboids(self):
     cs.init(3, {0:[0,1,2]})
     c1 = Cuboid([1,2,3],[7,8,9], {0:[0,1,2]})
     c2 = Cuboid([4,5,6],[7,9,7], {0:[0,1,2]})
     s = Core([c1, c2], {0:[0,1,2]})
     p = [12,-2,8]
     self.assertEqual(s.find_closest_point_candidates(p), [[7,2,8],[7,5,7]])
Exemplo n.º 3
0
 def test_find_closest_point_candidates_one_cuboid(self):
     cs.init(3, {0: [0, 1, 2]})
     c = Cuboid([1, 2, 3], [7, 8, 9], {0: [0, 1, 2]})
     s = Core([c], {0: [0, 1, 2]})
     p = [12, -2, 7]
     self.assertEqual(s.find_closest_point_candidates(p), [[7, 2, 7]])