Changeset 684 for inundation


Ignore:
Timestamp:
Dec 7, 2004, 4:06:17 PM (20 years ago)
Author:
duncan
Message:

update from Vanessa

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inundation/ga/storm_surge/alpha_shape/alpha_shape.py

    r674 r684  
    9090        pointattlist = [ [] for i in range(len(points)) ]
    9191        mode = "Qzcn"
    92         #print "compute delaunay triangulation"
     92        print "computing delaunay triangulation ... \n"
    9393        tridata = triang.genMesh(points,seglist,holelist,regionlist,pointattlist,segattlist,trilist,mode)
    9494        #print tridata
     
    9999        self.hulledges = tridata['generatedsegmentlist']                             
    100100
    101         #print "deltri: ", self.deltri, "\n"
     101        print "Number of delaunay triangles: ", len(self.deltri), "\n"
    102102        #print "deltrinbrs: ", self.deltrinbr, "\n"
    103103
    104104        # Build Alpha table
     105        print "Building alpha table ... \n"
    105106        self._tri_circumradius()
     107        print "Largest circumradius ", max(self.triradius)
    106108        self._edge_intervals()
    107109        self._vertex_intervals()
     
    112114            # every vertex is non-singular so...
    113115            self.optimum_alpha = max([ interval[0] for interval in self.vertexinterval])
    114             #print "optimum alpha ", self.optimum_alpha
     116            print "optimum alpha ", self.optimum_alpha
    115117
    116118            #alpha_tri = self.get_alpha_triangles(self.optimum_alpha)
     
    247249        for i in range(nv):
    248250            radii = [ self.triradius[t] for t in vertexnbrs[i] if t>=0 ]
    249             vertexinterval[i] = [min(radii), max(radii)]
    250             if vertexnbrs[i][-1]==-1:
    251                 vertexinterval[i][1]=INF
     251            try:
     252                vertexinterval[i] = [min(radii), max(radii)]
     253                if vertexnbrs[i][-1]==-1:
     254                    vertexinterval[i][1]=INF
     255            except ValueError:
     256                print "Vertex %i is isolated?"%i
     257                print "coords: ",self.points[i]
     258                print "Vertex nbrs: ", vertexnbrs[i]
     259                print "nbr radii: ",radii
     260                vertexinterval[i] = [0,INF]
     261                pass
    252262
    253263        self.vertexnbr = vertexnbrs
     
    303313            alpha = None
    304314
     315        print "about to call alpha shape routine \n"
    305316        alpha_shape_via_files(point_file, boundary_file, alpha)
    306317       
Note: See TracChangeset for help on using the changeset viewer.