Changeset 1100


Ignore:
Timestamp:
Mar 17, 2005, 2:36:37 PM (20 years ago)
Author:
duncan
Message:

modify extent so it returns a polygon

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inundation/ga/storm_surge/pmesh/load_mesh/loadASCII.py

    r1099 r1100  
    3131    segment_tags : [tag,tag,...] list of strings
    3232    triangles : [(v1,v2,v3), (v4,v5,v6),....] lists of points
    33     triangle tags: [[s1],[s2],...] A list of list of strings (probably not neccecary.  a list of string should be ok)
    34     triangle neighbors: [[t1,t2,t3], [t4,t5,t6],..] lists of triangles
     33    triangle_tags: [[s1],[s2],...] A list of list of strings (probably not neccecary.  a list of string should be ok)
     34    triangle_neighbors: [[t1,t2,t3], [t4,t5,t6],..] lists of triangles
    3535       
    3636    (the outline)   
     
    419419     
    420420    numVert = str(len(vertices))
    421     if (numVert == "0"):
     421    if (numVert == "0") or len(vertices_attributes) == 0:
    422422        numVertAttrib = "0"
    423423    else:
     
    519519        mesh_dict['region_max_areas'] = []
    520520   
     521 
     522    if not mesh_dict.has_key('vertices'):
     523        mesh_dict['vertices'] = []
     524    if not mesh_dict.has_key('vertex_attributes'):
     525        mesh_dict['vertex_attributes'] = []
     526    if not mesh_dict.has_key('vertex_attribute_titles'):
     527        mesh_dict['vertex_attribute_titles'] = []
     528    if not mesh_dict.has_key('segments'):
     529        mesh_dict['segments'] = []
     530    if not mesh_dict.has_key('segment_tags'):
     531        mesh_dict['segment_tags'] = []
     532    if not mesh_dict.has_key('triangles'):
     533        mesh_dict['triangles'] = []
     534    if not mesh_dict.has_key('triangle_tags'):
     535        mesh_dict['triangle_tags'] = []
     536    if not mesh_dict.has_key('triangle_neighbors'):
     537        mesh_dict['triangle_neighbors'] = []
    521538    #print "DSG************"
    522539    #print "mesh_dict",mesh_dict
     
    963980        if y > max_y: max_y = y
    964981        if y < min_y: min_y = y
    965     extent = array([[min_x,min_y],[max_x,min_y],[min_x,max_y],[max_x,max_y]])
     982    extent = array([[min_x,min_y],[max_x,min_y],[max_x,max_y],[min_x,max_y]])
    966983    #print "extent",extent
    967984    return extent
Note: See TracChangeset for help on using the changeset viewer.