Пример #1
0
 def testRelationships(self):
     p = ConvexPolygon(
         [UnitVector3d.Z(),
          UnitVector3d.X(),
          UnitVector3d.Y()])
     self.assertTrue(p.contains(p.getCentroid()))
     self.assertEqual(p.getBoundingCircle().relate(p), CONTAINS)
 def testRelationships(self):
     p = ConvexPolygon(
         [UnitVector3d.Z(),
          UnitVector3d.X(),
          UnitVector3d.Y()])
     self.assertTrue(p.contains(p.getCentroid()))
     boundingCircle = p.getBoundingCircle()
     self.assertEqual(boundingCircle.relate(p), CONTAINS)
     self.assertTrue(p.isWithin(boundingCircle))
     self.assertTrue(p.intersects(boundingCircle))
     self.assertFalse(p.isDisjointFrom(boundingCircle))
     self.assertFalse(p.contains(boundingCircle))
     tinyCircle = Circle(boundingCircle.getCenter())
     self.assertFalse(p.isWithin(tinyCircle))
     self.assertTrue(p.intersects(tinyCircle))
     self.assertFalse(p.isDisjointFrom(tinyCircle))
     self.assertTrue(p.contains(tinyCircle))
 def testRelationships(self):
     p = ConvexPolygon([UnitVector3d.Z(), UnitVector3d.X(), UnitVector3d.Y()])
     self.assertTrue(p.contains(p.getCentroid()))
     self.assertEqual(p.getBoundingCircle().relate(p), CONTAINS)