def test_create_from_points(self): points = np.array([[-1.0, -1.0, -1.0]]) result = aabb.create_from_points(points) expected = np.array([[-1.0, -1.0, -1.0], [-1.0, -1.0, -1.0]]) self.assertTrue(np.array_equal(result, expected)) points = np.array([ [-1.0, -1.0, -1.0], [-1.0, 2.0, -2.0], ]) result = aabb.create_from_points(points) expected = np.array([ [-1.0, -1.0, -2.0], [-1.0, 2.0, -1.0], ]) self.assertTrue(np.array_equal(result, expected))
def test_centre_point_multiple_points(self): points = np.array([ [ 1.0, 1.0, 1.0], [-1.0,-1.0,-1.0] ]) obj = aabb.create_from_points(points) result = aabb.centre_point(obj) expected = np.zeros(3) self.assertTrue(np.array_equal(result, expected))
def test_create_from_points(self): points = np.array([[-1.0,-1.0,-1.0]]) result = aabb.create_from_points(points) expected = np.array([ [-1.0,-1.0,-1.0], [-1.0,-1.0,-1.0] ]) self.assertTrue(np.array_equal(result, expected)) points = np.array([ [-1.0,-1.0,-1.0], [-1.0, 2.0,-2.0], ]) result = aabb.create_from_points(points) expected = np.array([ [-1.0,-1.0,-2.0], [-1.0, 2.0,-1.0], ]) self.assertTrue(np.array_equal(result, expected))
def single_point(): points = numpy.array( [ [-1.0,-1.0,-1.0 ] ] ) obj = aabb.create_from_points( points ) result = aabb.centre_point( obj ) expected = numpy.array( [-1.0,-1.0,-1.0 ] ) self.assertTrue( numpy.array_equal( result, expected ), "AABB single point centre point incorrect" )
def multiple_points(): points = numpy.array( [ [ 1.0, 1.0, 1.0 ], [-1.0,-1.0,-1.0 ] ] ) obj = aabb.create_from_points( points ) result = aabb.centre_point( obj ) expected = numpy.zeros( 3 ) self.assertTrue( numpy.array_equal( result, expected ), "AABB multiple points centre point incorrect" )
def test_create_from_points( self ): """ points = numpy.array( [ [-1.0,-1.0,-1.0] ] ) """ points = numpy.array( [ [-1.0,-1.0,-1.0 ] ] ) result = aabb.create_from_points( points ) expected = numpy.tile( points, (2,1) ) self.assertTrue( numpy.array_equal( result, expected ), "Create from points failed" )
def test_centre_point_multiple_points(self): points = np.array([[1.0, 1.0, 1.0], [-1.0, -1.0, -1.0]]) obj = aabb.create_from_points(points) result = aabb.centre_point(obj) expected = np.zeros(3) self.assertTrue(np.array_equal(result, expected))
def test_centre_point_single_point(self): points = np.array([[-1.0, -1.0, -1.0]]) obj = aabb.create_from_points(points) result = aabb.centre_point(obj) expected = np.array([-1.0, -1.0, -1.0]) self.assertTrue(np.array_equal(result, expected))
def test_centre_point_single_point(self): points = np.array([[-1.0,-1.0,-1.0]]) obj = aabb.create_from_points(points) result = aabb.centre_point(obj) expected = np.array([-1.0,-1.0,-1.0]) self.assertTrue(np.array_equal(result, expected))