Ignore:
Timestamp:
Dec 19, 2006, 3:30:43 PM (17 years ago)
Author:
nick
Message:

add number of trigs in mesh

File:
1 edited

Legend:

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

    r3803 r4095  
    732732    return point
    733733
     734def number_mesh_triangles(interior_regions, bounding_poly, remainder_res):
     735    """Calcalutes the approximate number of triangles inside the bounding polygon
     736    and the other interior regions
     737    FIXME: Add tests for this function
     738    """
     739    import polygon_area
     740   
     741    # TO DO check if any of the regions fall inside one another
     742    no_triangles = 0.0
     743    area = polygon_area(bounding_poly)
     744    for i,j in interior_regions:
     745        this_area = polygon_area(i)
     746        no_triangles += this_area/j
     747        area -= this_area
     748        #convert to square Kms
     749        print 'area of ',j, this_area/1000000., area/1000000.
     750    no_triangles += area/remainder_res
     751    return int(no_triangles/0.7)
     752
    734753
    735754
Note: See TracChangeset for help on using the changeset viewer.