Changeset 4095 for anuga_core/source/anuga/utilities/polygon.py
- Timestamp:
- Dec 19, 2006, 3:30:43 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/utilities/polygon.py
r3803 r4095 732 732 return point 733 733 734 def 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 734 753 735 754
Note: See TracChangeset
for help on using the changeset viewer.