Skip to content

Commit

Permalink
Remove lint in test_predicates_2.py
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvanmele authored and gonzalocasas committed Sep 10, 2023
1 parent 7b713b6 commit dbdcb51
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/compas/geometry/predicates/test_predicates_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ def test_is_point_in_circle_xy_class_input():

def test_is_polygon_in_polygon_xy():
polygon_contour = Polygon([(0, 0, 0), (4, 2, 0), (10, 0, 0), (11, 10, 0), (8, 12, 0), (0, 10, 0)])
polygon_inside = Polygon([(5, 5, 0), (10, 5, 0), (10, 10 ,0), (5, 10, 0)])
assert is_polygon_in_polygon_xy(polygon_contour, polygon_inside) is True
polygon_inside = Polygon([(5, 5, 0), (10, 5, 0), (10, 10 , 0), (5, 10, 0)])
assert is_polygon_in_polygon_xy(polygon_contour, polygon_inside)

polygon_outside = Polygon([(15, 5, 0), (20, 5, 0), (20, 10, 0), (15, 10, 0)])
assert is_polygon_in_polygon_xy(polygon_contour, polygon_outside) is False
assert not is_polygon_in_polygon_xy(polygon_contour, polygon_outside)

polygon_intersecting = Polygon([(10, 10, 0), (10, 5, 0), (15, 5, 0), (15, 10, 0)])
assert is_polygon_in_polygon_xy(polygon_contour, polygon_intersecting) is False
assert not is_polygon_in_polygon_xy(polygon_contour, polygon_intersecting)

# shifting the vertices list of the same polygon shouldn't affect the containment check output anymore
polygon_intersecting_shifted = Polygon(polygon_intersecting[1:] + polygon_intersecting[:1])
assert is_polygon_in_polygon_xy(polygon_contour, polygon_intersecting_shifted) is False
assert not is_polygon_in_polygon_xy(polygon_contour, polygon_intersecting_shifted)

0 comments on commit dbdcb51

Please sign in to comment.