Ignore:
Timestamp:
Apr 15, 2010, 8:45:36 PM (13 years ago)
Author:
hudson
Message:

Tickets 346/257: Added a simple brute-force is_complex function to find complex (ie pathological/self intersecting) polygons.
Added unit test to test above.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/utilities/test_polygon.py

    r7308 r7686  
    18061806        assert res is False
    18071807
     1808    def test_is_polygon_complex(self):
     1809        concave_poly = [[0, 0], [10, 0], [5, 5], [10, 10], [0, 10]]
     1810        complex_poly = [[0, 0], [10, 0], [5, 5], [5, 15], [5, 7], [10, 10], [0, 10]]
     1811       
     1812        assert not is_complex(concave_poly)
     1813        assert is_complex(complex_poly)
     1814       
     1815       
    18081816################################################################################
    18091817
Note: See TracChangeset for help on using the changeset viewer.