def test_clamp_points_list(self): a = aabb.create_from_bounds([-1, -1, -1], [1, 1, 1]) points = np.array([ [1, 1, 1], [2, 1, 1], [-1, -1, -1], [-2, -2, -2], ]) result = aabb.clamp_points(a, points) expected = np.array([[1, 1, 1], [1, 1, 1], [-1, -1, -1], [-1, -1, -1]]) self.assertTrue(np.array_equal(result, expected))
def test_clamp_points_list(self): a = aabb.create_from_bounds([-1,-1,-1],[1,1,1]) points = np.array([ [1,1,1], [2,1,1], [-1,-1,-1], [-2,-2,-2], ]) result = aabb.clamp_points(a, points) expected = np.array([[1,1,1],[1,1,1],[-1,-1,-1],[-1,-1,-1]]) self.assertTrue(np.array_equal(result, expected))
def clamp_points( bb, points ): """Takes a list of points and modifies them to fit within the AABB. """ # use the same function as present in AABB aabb.clamp_points( bb, points )