def setUp(self): self.centre = ( 1.1, 2.2, 3.3 ) self.radius = 4.4 self.bsphere = primitive.bsphere( centre = self.centre, radius = self.radius )
def test_with_bsphere(self): b1 = bsphere(centre=(0, 1, 2), radius=0.01) self.assertTrue(self.tester(left=b1, right=b1)) self.assertTrue( self.tester( left=bsphere(centre=(1, 2, 3), radius=1), right=bsphere(centre=(2, 3, 4), radius=1), )) self.assertFalse( self.tester( left=bsphere(centre=(1, 2, 3), radius=0.5), right=bsphere(centre=(2, 3, 4), radius=0.5), )) self.assertTrue( self.tester( left=bsphere(centre=(1, 2, 3), radius=0.51), right=bsphere(centre=(2, 3, 4), radius=0.5), )) self.assertFalse( self.tester( left=bsphere(centre=(1, 2, 3), radius=0.5), right=bsphere(centre=(2, 2, 3), radius=0.5), )) self.assertTrue( self.tester( left=bsphere(centre=(1, 2, 3), radius=0.51), right=bsphere(centre=(2, 2, 3), radius=0.5), ))
def test_with_bsphere(self): b1 = bsphere(centre=(0, 1, 2), radius=0.01) self.assertTrue(self.tester(left=b1, right=b1)) self.assertTrue( self.tester(left=bsphere(centre=(1, 2, 3), radius=1), right=bsphere(centre=(2, 3, 4), radius=1)) ) self.assertFalse( self.tester(left=bsphere(centre=(1, 2, 3), radius=0.5), right=bsphere(centre=(2, 3, 4), radius=0.5)) ) self.assertTrue( self.tester(left=bsphere(centre=(1, 2, 3), radius=0.51), right=bsphere(centre=(2, 3, 4), radius=0.5)) ) self.assertFalse( self.tester(left=bsphere(centre=(1, 2, 3), radius=0.5), right=bsphere(centre=(2, 2, 3), radius=0.5)) ) self.assertTrue( self.tester(left=bsphere(centre=(1, 2, 3), radius=0.51), right=bsphere(centre=(2, 2, 3), radius=0.5)) )