예제 #1
0
 def test_decreasing_line(self):
     line = LineSegment([Point([3, 5]), Point([6, 2])])
     assert line.begin not in self.obs
     assert not line.crosses_obstacle(self.obs)
예제 #2
0
 def test_line_close_to_border(self):
     line = LineSegment([Point([4, 5]), Point([5, 6.94])])
     assert line.begin not in self.obs and line.end not in self.obs
     assert not line.crosses_obstacle(self.obs)
예제 #3
0
 def test_line_starting_close_to_corner(self):
     line = LineSegment([Point([7.01, 10.01]), Point([7, 15])])
     assert line.begin not in self.obs
     assert not line.crosses_obstacle(self.obs)
예제 #4
0
 def test_line_far_from_obstacle(self):
     line = LineSegment([Point([4, 5]), Point([2, 3])])
     assert line.begin not in self.obs and line.end not in self.obs
     assert not line.crosses_obstacle(self.obs)
예제 #5
0
 def test_line_ending_in_corner(self):
     line = LineSegment([Point([3, 4]), Point([5, 7])])
     assert line.end in self.obs
     assert line.crosses_obstacle(self.obs, open_sets=False)
     assert not line.crosses_obstacle(self.obs, open_sets=True)
예제 #6
0
 def test_line_starting_in_corner(self):
     line = LineSegment([Point([7, 10]), Point([7, 15])])
     assert line.begin in self.obs
     assert line.crosses_obstacle(self.obs)
     assert not line.crosses_obstacle(self.obs, open_sets=True)
예제 #7
0
 def test_line_starting_in_obstacle(self):
     line = LineSegment([Point([6, 8]), Point([7, 15])])
     assert line.begin in self.obs
     assert line.crosses_obstacle(self.obs)
예제 #8
0
 def test_line_passing_through_obstacle(self):
     line = LineSegment([Point([6, 6]), Point([6, 11])])
     assert line.begin not in self.obs and line.end not in self.obs
     assert line.crosses_obstacle(self.obs)