Exemplo n.º 1
0
 def test_polyline_line_no_intersection(self, polyline1):
     line = Line(Vector2(10, 12), Vector2(13, 14))
     assert not polyline1.intersects(line)
     assert not line.intersects(polyline1)
Exemplo n.º 2
0
 def test_polyline_line_intersection(self, polyline1):
     line = Line(Vector2(3, 4), Vector2(4.5, 5.5))
     assert polyline1.intersects(line)
     assert line.intersects(polyline1)
Exemplo n.º 3
0
 def test_line_line_intersection(self):
     line1 = Line(Vector2(-1, -1), Vector2(1, 1))
     line2 = Line(Vector2(-1, 1), Vector2(1, -1))
     assert line1.intersects(line2)
     assert line2.intersects(line1)
Exemplo n.º 4
0
 def test_line_line_intersection_with_itself(self):
     line1 = Line(Vector2(1, 1), Vector2(1, 2))
     line2 = Line(Vector2(1, 1), Vector2(1, 2))
     assert line1.intersects(line2)
     assert line2.intersects(line1)
Exemplo n.º 5
0
 def test_line_line_no_intersection(self):
     line1 = Line(Vector2(1, 1), Vector2(1, 2))
     line2 = Line(Vector2(1 + 1, 1 + 1), Vector2(1 + 1, 2 + 1))
     assert not line1.intersects(line2)
     assert not line2.intersects(line1)
Exemplo n.º 6
0
 def test_line_circle_intersection(self, unit_circle):
     line = Line(Vector2(0, 0.8), Vector2(1, 2))
     assert unit_circle.intersects(line)
     assert line.intersects(unit_circle)
Exemplo n.º 7
0
 def test_line_circle_no_intersection(self, unit_circle):
     line = Line(Vector2(1, 1), Vector2(1, 2))
     assert not unit_circle.intersects(line)
     assert not line.intersects(unit_circle)