Changeset 3072 for inundation/pyvolution/mesh.py
- Timestamp:
- Jun 5, 2006, 12:03:41 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/pyvolution/mesh.py
r3062 r3072 426 426 427 427 428 def get_boundary_polygon(self, verbose =False):428 def get_boundary_polygon(self, verbose=False): 429 429 """Return bounding polygon for mesh (counter clockwise) 430 430 … … 432 432 If multiple vertex values are present, the algorithm will select the 433 433 path that contains the mesh. 434 435 All points are in absolute UTM coordinates 434 436 """ 435 437 … … 438 440 439 441 440 # FIXME (Ole): Make sure all points are absolute UTM441 442 442 # Get mesh extent 443 xmin, xmax, ymin, ymax = self.get_extent( ) # FIXME: Make Absolute443 xmin, xmax, ymin, ymax = self.get_extent(absolute=True) 444 444 pmin = ensure_numeric([xmin, ymin]) 445 445 pmax = ensure_numeric([xmax, ymax]) … … 456 456 if edge_id == 2: a = 0; b = 1 457 457 458 # FIXME: Make Absolute 459 A = self.get_vertex_coordinate(i, a) # Start460 B = self.get_vertex_coordinate(i, b) # End 458 A = self.get_vertex_coordinate(i, a, absolute=True) # Start 459 B = self.get_vertex_coordinate(i, b, absolute=True) # End 460 461 461 462 462 # Take the point closest to pmin as starting point … … 488 488 489 489 490 490 491 491 #Start with smallest point and follow boundary (counter clock wise) 492 492 polygon = [p0] # Storage for final boundary polygon 493 point_registry = {} # Keep track of storage to avoid multiple runs around boundary 494 # This will only be the case if there are more than one candidate 495 # FIXME (Ole): Perhaps we can do away with polygon and use 496 # only point_registry to save space. 493 point_registry = {} # Keep track of storage to avoid multiple runs around 494 # boundary. This will only be the case if there are 495 # more than one candidate. 496 # FIXME (Ole): Perhaps we can do away with polygon 497 # and use only point_registry to save space. 497 498 498 499 point_registry[tuple(p0)] = 0 … … 509 510 510 511 if verbose: 511 print 'Point %s has multiple candidates: %s' %(str(p0), candidate_list) 512 print 'Point %s has multiple candidates: %s'\ 513 %(str(p0), candidate_list) 512 514 513 515 … … 516 518 v_prev = p0 - polygon[-2] # Vector that leads to p0 517 519 else: 518 # FIXME (Ole): What do we do if the first point has multiple candidates? 520 # FIXME (Ole): What do we do if the first point has multiple 521 # candidates? 519 522 # Being the lower left corner, perhaps we can use the 520 523 # vector [1, 0], but I really don't know if this is completely … … 530 533 vc = pc-p0 # Candidate vector 531 534 532 # Angle between each candidate and the previous vector in [-pi, pi] 535 # Angle between each candidate and the previous vector 536 # in [-pi, pi] 533 537 ac = angle(vc, v_prev) 534 538 if ac > pi: ac = pi-ac
Note: See TracChangeset
for help on using the changeset viewer.