Changeset 8054


Ignore:
Timestamp:
Oct 29, 2010, 11:00:29 AM (13 years ago)
Author:
habili
Message:

Test for line intersect

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/geometry/test_polygon.py

    r8038 r8054  
    1313                    plot_polygons, outside_polygon, is_outside_polygon, \
    1414                    intersection, is_complex, polygon_overlap, not_polygon_overlap,\
    15                     polyline_overlap, not_polyline_overlap,\
     15                    line_intersect, not_line_intersect,\
    1616                    is_inside_triangle, interpolate_polyline, inside_polygon, \
    1717                    in_and_outside_polygon
     
    503503        assert num.allclose([0], indices)             
    504504                     
    505     def test_polyline_overlap(self):
     505    def test_line_intersect(self):
    506506        #rectangular polygon, 2 triangles overlap
    507         polyline = [[3.,3.],[4.,3.]]
     507        line = [[3.,3.],[4.,3.]]
    508508        triangles = [[7.,10.],#does not overlap
    509509                     [8.,12.],
     
    525525                     [3., 1.]]
    526526                     
    527         indices = polyline_overlap(triangles, polyline)       
     527        indices = line_intersect(triangles, line)       
    528528        assert num.allclose([1, 2, 3, 5], indices)
    529529
    530     def test_not_polyline_overlap(self):
     530    def test_not_line_intersect(self):
    531531        #rectangular polygon, 2 triangles overlap
    532         polyline = [[3.,3.],[4.,3.]]
     532        line = [[3.,3.],[4.,3.]]
    533533        triangles = [[7.,10.],#does not overlap
    534534                     [8.,12.],
     
    550550                     [3., 1.]]
    551551 
    552         indices = not_polyline_overlap(triangles, polyline)       
     552        indices = not_line_intersect(triangles, line)
    553553        assert num.allclose([4, 0], indices)
    554554
Note: See TracChangeset for help on using the changeset viewer.