Exemple #1
0
    def test_intersects(self):
        polyline1 = CPolyline(init_points=[(0, 0), (1, 0), (1, 1)])
        polyline2 = CPolyline(init_points=[(0.50, 0.50), (1.50, 0.50)])
        polyline3 = Polyline(init_points=[(0.50, 0.50), (1.50, 0.50)])
        polyline4 = CPolyline(init_points=[(0.50, 1.50), (1.50, 1.50)])

        self.assertTrue(polyline1.intersects(polyline2))
        self.assertTrue(polyline1.intersects(polyline3))
        self.assertFalse(polyline1.intersects(polyline4))
Exemple #2
0
 def test_intersects2(self):
     polyline = CPolyline(init_points=[(2, 10), (2, 100)])
     self.assertTrue(polyline.intersects(polyline))