def testConstruction(self): i = Interval1d(1) self.assertEqual(i.getA(), i.getB()) self.assertEqual(i.getA(), 1) i = Interval1d(1, 2) self.assertEqual(i, Interval1d(1, 2)) self.assertTrue(Interval1d.empty().isEmpty())
def test_construction(self): a = Box3d(Vector3d(0, 0, 0)) b = Box3d(a) self.assertEqual(a, b) self.assertNotEqual(id(a), id(b)) a = Box3d(Vector3d(1, 2, 3), Vector3d(3, 4, 5)) b = Box3d(Interval1d(1, 3), Interval1d(2, 4), Interval1d(3, 5)) c = Box3d(Vector3d(2, 3, 4), 1, 1, 1) self.assertEqual(a, b) self.assertEqual(b, c) i = Interval1d(1, 2) self.assertEqual(i, Interval1d(1, 2)) self.assertTrue(Interval1d.empty().isEmpty())