Esempio n. 1
0
 def test_intersect_vertical_line(self):
     line = ConstructionLine((0, 0), (0, 10))
     assert line.intersect(ConstructionLine((0, 0), (0, 10))) is None
     assert line.intersect(ConstructionLine((1, 0), (1, 10))) is None
     assert line.intersect(ConstructionLine((-1, 0), (1, 10))) == (0, 5)
     assert line.intersect(ConstructionLine((-1, 0), (1, 0))) == (0, 0)
     assert line.intersect(ConstructionLine((-1, 10), (1, 10))) == (0, 10)
     assert line.intersect(ConstructionLine((-1, 11), (1, 11))) is None
Esempio n. 2
0
 def test_intersect_horizontal_line(self):
     line = ConstructionLine((0, 0), (10, 0))
     assert line.intersect(ConstructionLine((0, 0), (10, 0))) is None
     assert line.intersect(ConstructionLine((0, 1), (10, 1))) is None
     assert line.intersect(ConstructionLine((0, -1), (10, 1))) == (5, 0)
     assert line.intersect(ConstructionLine((5, 5), (5, -5))) == (5, 0)
     assert line.intersect(ConstructionLine((5, 5), (5, 1))) is None
     assert line.intersect(ConstructionLine((0, 0), (5, 5))) == (0, 0)