Changeset 8031
- Timestamp:
- Oct 10, 2010, 5:13:51 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga/geometry/polygon.py
r8009 r8031 221 221 return status, value 222 222 223 def polygon_overlap(triangles, polygon, verbose=False): 224 """Determine if a polygon and triangle overlap 225 226 """ 227 polygon = ensure_numeric(polygon) 228 triangles = ensure_numeric(triangles) 229 230 M = triangles.shape[0]/3 # Number of triangles 231 232 indices = num.zeros(M, num.int) 233 234 count = _polygon_overlap(polygon, triangles, indices) 235 236 if verbose: 237 log.critical('Found %d triangles (out of %d) that polygon' % (count, M)) 238 239 return indices[:count] 240 241 def not_polygon_overlap(triangles, polygon, verbose=False): 242 """Determine if a polygon and triangle overlap 243 244 """ 245 polygon = ensure_numeric(polygon) 246 triangles = ensure_numeric(triangles) 247 248 M = triangles.shape[0]/3 # Number of triangles 249 250 indices = num.zeros(M, num.int) 251 252 count = _polygon_overlap(polygon, triangles, indices) 253 254 if verbose: 255 log.critical('Found %d triangles (out of %d) that polygon' % (count, M)) 256 257 return indices[count:] 258 223 259 def is_inside_triangle(point, triangle, 224 260 closed=True, … … 1098 1134 from polygon_ext import _separate_points_by_polygon 1099 1135 from polygon_ext import _interpolate_polyline 1136 from polygon_ext import _polygon_overlap 1100 1137 from polygon_ext import _is_inside_triangle 1101 1138 #from polygon_ext import _intersection
Note: See TracChangeset
for help on using the changeset viewer.