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))
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))
def setUp(self): P1, P2, R = (0, 0, 0), (40, 0, 0), 10 self.cyl1 = Cylinder(P1, P2, R)
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)))