Changeset 3719 for anuga_core/source/anuga/pmesh/mesh_interface.py
- Timestamp:
- Oct 10, 2006, 10:48:31 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/pmesh/mesh_interface.py
r3715 r3719 25 25 filename=None, 26 26 interior_regions=None, 27 interior_holes=None, 27 28 poly_geo_reference=None, 28 29 mesh_geo_reference=None, … … 43 44 Interior_regions is a list of tuples consisting of (polygon, resolution) 44 45 for each region to be separately refined. 46 47 Interior_holes is a list of ploygons for each hole. 45 48 46 49 This function does not allow segments to share points - use underlying … … 71 74 'filename': filename, 72 75 'interior_regions': interior_regions, 76 'interior_holes': interior_holes, 73 77 'poly_geo_reference': poly_geo_reference, 74 78 'mesh_geo_reference': mesh_geo_reference, … … 106 110 filename=None, 107 111 interior_regions=None, 112 interior_holes=None, 108 113 poly_geo_reference=None, 109 114 mesh_geo_reference=None, … … 146 151 raise PolygonError, msg 147 152 148 153 if interior_holes is not None: 154 # Test that all the interior polygons are inside the bounding_poly 155 for interior_polygon, res in interior_holes: 156 indices = inside_polygon(interior_polygon, bounding_polygon, 157 closed = True, verbose = False) 158 159 if len(indices) <> len(interior_polygon): 160 msg = 'Interior polygon %s is outside bounding polygon: %s'\ 161 %(str(interior_polygon), str(bounding_polygon)) 162 raise PolygonError, msg 149 163 150 164 # Resolve geo referencing … … 192 206 193 207 # Do interior regions 208 # if interior_regions is not None: 209 # for polygon, res in interior_regions: 210 # m.add_region_from_polygon(polygon, 211 # geo_reference=poly_geo_reference) 212 # # convert bounding poly to absolute values 213 # if poly_geo_reference is not None: 214 # polygon_absolute = \ 215 # poly_geo_reference.get_absolute(polygon) 216 # else: 217 # polygon_absolute = polygon 218 # inner_point = point_in_polygon(polygon_absolute) 219 # region = m.add_region(inner_point[0], inner_point[1]) 220 # region.setMaxArea(res) 221 222 194 223 if interior_regions is not None: 195 224 for polygon, res in interior_regions: 196 225 m.add_region_from_polygon(polygon, 226 max_triangle_area = res, 197 227 geo_reference=poly_geo_reference) 198 # convert bounding poly to absolute values 199 if poly_geo_reference is not None: 200 polygon_absolute = \ 201 poly_geo_reference.get_absolute(polygon) 202 else: 203 polygon_absolute = polygon 204 inner_point = point_in_polygon(polygon_absolute) 205 region = m.add_region(inner_point[0], inner_point[1]) 206 region.setMaxArea(res) 228 229 230 # Do interior holes 231 if interior_holes is not None: 232 for polygon, res in interior_holes: 233 m.add_hole_from_polygon(polygon, 234 geo_reference=poly_geo_reference) 235 207 236 208 237
Note: See TracChangeset
for help on using the changeset viewer.