Changeset 8037
 Timestamp:
 Oct 15, 2010, 5:16:59 PM (12 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/anuga_core/source/anuga/geometry/polygon.py
r8031 r8037 257 257 return indices[count:] 258 258 259 def polyline_overlap(triangles, polyline, verbose=False): 260 """Determine if a polygon and triangle overlap 261 262 """ 263 polyline = ensure_numeric(polyline) 264 triangles = ensure_numeric(triangles) 265 266 M = triangles.shape[0]/3 # Number of triangles 267 268 indices = num.zeros(M, num.int) 269 270 count = _polyline_overlap(polyline, triangles, indices) 271 272 if verbose: 273 log.critical('Found %d triangles (out of %d) that polygon' % (count, M)) 274 275 return indices[:count] 276 277 def not_polyline_overlap(triangles, polyline, verbose=False): 278 """Determine if a polyline and triangle overlap 279 280 """ 281 polyline = ensure_numeric(polyline) 282 triangles = ensure_numeric(triangles) 283 284 M = triangles.shape[0]/3 # Number of triangles 285 286 indices = num.zeros(M, num.int) 287 288 count = _polyline_overlap(polyline, triangles, indices) 289 290 if verbose: 291 log.critical('Found %d triangles (out of %d) that polygon' % (count, M)) 292 293 return indices[count:] 294 295 259 296 def is_inside_triangle(point, triangle, 260 297 closed=True, … … 1135 1172 from polygon_ext import _interpolate_polyline 1136 1173 from polygon_ext import _polygon_overlap 1174 from polygon_ext import _polyline_overlap 1137 1175 from polygon_ext import _is_inside_triangle 1138 1176 #from polygon_ext import _intersection
Note: See TracChangeset
for help on using the changeset viewer.