Changeset 7308 for anuga_core/source/anuga/utilities/test_polygon.py
- Timestamp:
- Jul 12, 2009, 10:53:38 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/utilities/test_polygon.py
r7276 r7308 304 304 points = [[0.5, 0.5], [1, -0.5], [1.5, 0], [0.5, 1.5], [0.5, -0.5]] 305 305 res = inside_polygon( points, polygon, verbose=False ) 306 assert num.allclose( res, [0,1,2])306 assert num.allclose(res, [0,1,2]) 307 307 308 308 def test_outside_polygon(self): … … 585 585 points = [(1., 0.25),(1., 0.75)] 586 586 inside, outside = in_and_outside_polygon(points, polygon, closed=True) 587 assert (inside,[0,1])587 assert num.alltrue(inside == [0,1]) 588 588 assert len(outside) == 0 589 589 590 590 inside, outside = in_and_outside_polygon(points, polygon, closed=False) 591 591 assert len(inside) == 0 592 assert (outside,[0,1])592 assert num.alltrue(outside == [0,1]) 593 593 594 594 points = [(100., 0.25), (0.5, 0.5) ] 595 595 inside, outside = in_and_outside_polygon(points, polygon) 596 assert (inside,[1])596 assert num.alltrue(inside == [1]) 597 597 assert outside[0] == 0 598 598 599 599 points = [(100., 0.25),(0.5, 0.5), (39,20), (0.6,0.7),(56,43),(67,90)] 600 600 inside, outside = in_and_outside_polygon(points, polygon) 601 assert (inside,[1, 3])602 assert (outside,[0, 2, 4, 5])601 assert num.alltrue(inside == [1, 3]) 602 assert num.alltrue(outside == [0, 2, 4, 5]) 603 603 604 604 def test_intersection1(self):
Note: See TracChangeset
for help on using the changeset viewer.