def __init__(self): self.color = Color(0.0, 0.0, 0.0) self.aabb = aabb.create_from_bounds([0.0, 0.0, 0.0], [0.5, 0.5, 0.5]) self.translation_matrix = Matrix44.identity() self.scale_matrix = Matrix44.identity() self.rotation_matrix = Matrix44.identity() self.selected = False
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 test_maximum(self): a = aabb.create_from_bounds([-1, -1, -1], [1, 1, 1]) result = aabb.maximum(a) self.assertTrue(np.array_equal(result, [1, 1, 1]))
def test_create_from_bounds(self): result = aabb.create_from_bounds([-1, -1, -1], [1, 1, 1]) self.assertTrue(np.array_equal(result, [[-1, -1, -1], [1, 1, 1]]))
def __init__(self, min, max): self._box = aabb.create_from_bounds(min, max)
def test_create_from_bounds(self): result = aabb.create_from_bounds([-1,-1,-1],[1,1,1]) self.assertTrue(np.array_equal(result, [[-1,-1,-1],[1,1,1]]))
def test_maximum(self): a = aabb.create_from_bounds([-1,-1,-1],[1,1,1]) result = aabb.maximum(a) self.assertTrue(np.array_equal(result, [1,1,1]))