Ejemplo n.º 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))
Ejemplo n.º 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"
                )
Ejemplo n.º 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"
                )
Ejemplo n.º 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))
Ejemplo n.º 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))
Ejemplo n.º 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 )
Ejemplo n.º 7
0
Archivo: box.py Proyecto: ksons/ln.py
 def center(self) -> Vector3:
     return aabb.centre_point(self._box)
Ejemplo n.º 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))