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 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_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 centre_point( bb ): """Returns the centre point of the AABB. This should always be [0.0, 0.0, 0.0] """ return aabb.centre_point( bb )
def center(self) -> Vector3: return aabb.centre_point(self._box)
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))