Example #1
0
 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))
Example #2
0
        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"
                )
Example #3
0
        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"
                )
Example #4
0
 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))
Example #5
0
 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))
Example #6
0
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 )
Example #7
0
File: box.py Project: ksons/ln.py
 def center(self) -> Vector3:
     return aabb.centre_point(self._box)
Example #8
0
 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))