コード例 #1
0
class CylinderTest(unittest.TestCase):
    def setUp(self):
        P1, P2, R = (0, 0, 0), (40, 0, 0), 10
        self.cyl1 = Cylinder(P1, P2, R)

    def test_isPointInside(self):
        f = 10.0 / math.sqrt(2.0)
        for P in [(10,0,0), (20,0,0), (30,0,0), (10,f-0.1,f-0.1), (10,-f+0.1,-f+0.1)]:
            self.assertTrue(self.cyl1.isPointInside(P))
        for P in [(-10,0,0), (50,0,0), (10,f+0.1,f+0.1), (10,-f-0.1,-f-0.1)]:
            self.assertFalse(self.cyl1.isPointInside(P))
コード例 #2
0
class CylinderTest(unittest.TestCase):

    def setUp(self):
        P1, P2, R = (0,0,0), (40,0,0), 10
        self.cyl1 = Cylinder(P1, P2, R)

    def test_isPointInside(self):
        f = 10.0 / math.sqrt(2.0)
        for P in [(10,0,0), (20,0,0), (30,0,0), (10,f-0.1,f-0.1), (10,-f+0.1,-f+0.1)]:
            self.assertTrue(self.cyl1.isPointInside(P))
        for P in [(-10,0,0), (50,0,0), (10,f+0.1,f+0.1), (10,-f-0.1,-f-0.1)]:
            self.assertFalse(self.cyl1.isPointInside(P))
コード例 #3
0
 def setUp(self):
     P1, P2, R = (0, 0, 0), (40, 0, 0), 10
     self.cyl1 = Cylinder(P1, P2, R)
コード例 #4
0
ファイル: world_test.py プロジェクト: martinstoeger/magnum.fd
 def setUp(self):
     self.mesh = RectangularMesh((100, 100, 1), (1e-9, 1e-9, 1e-9))
     self.world = World(
         self.mesh, Body("body1", Material.Py(), Everywhere()),
         Body("body2", Material.Py(),
              Cylinder((0, 0, 0), (0, 50e-9, 0), 20e-9)))
コード例 #5
0
ファイル: shape_test.py プロジェクト: martinstoeger/magnum.fd
 def setUp(self):
     P1, P2, R = (0, 0, 0), (40, 0, 0), 10
     self.cyl1 = Cylinder(P1, P2, R)