Changeset 1632 for inundation/ga/storm_surge/pyvolution/general_mesh.py
- Timestamp:
- Jul 22, 2005, 5:59:19 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/pyvolution/general_mesh.py
r1587 r1632 173 173 174 174 175 def get_vertex_coordinates(self ):175 def get_vertex_coordinates(self, obj = False): 176 176 """Return all vertex coordinates. 177 177 Return all vertex coordinates for all triangles as an Nx6 array 178 178 (ordered as x0, y0, x1, y1, x2, y2 for each triangle) 179 """ 180 return self.vertex_coordinates 179 180 if obj is True, the x/y pairs are returned in a 3*N x 2 array. 181 FIXME, we might make that the default. 182 183 184 """ 185 186 if obj is True: 187 from Numeric import concatenate, reshape 188 V = self.vertex_coordinates 189 #return concatenate( (V[:,0:2], V[:,2:4], V[:,4:6]), axis=0) 190 191 N = V.shape[0] 192 return reshape(V, (3*N, 2)) 193 else: 194 return self.vertex_coordinates 181 195 182 196 … … 193 207 """ 194 208 195 #FIXME : Perhaps they should be ordered as in obj files??209 #FIXME (Ole): Perhaps they should be ordered as in obj files?? 196 210 #See quantity.get_vertex_values 211 #FIXME (Ole) - oh yes they should 197 212 198 213 from Numeric import zeros, Float … … 210 225 return vertex_coordinates 211 226 212 def get_vertices(self, 227 def get_vertices(self, indexes=None): 213 228 """Get connectivity 214 229 indexes is the set of element ids of interest … … 221 236 222 237 return take(self.triangles, indexes) 238 239 #FIXME - merge these two 240 def get_triangles(self, obj = False): 241 """Get connetivity 242 Return triangles (triplets of indices into point coordinates) 243 244 """ 245 246 if obj is True: 247 from Numeric import array, reshape, Int 248 m = len(self) #Number of triangles 249 M = 3*m #Total number of unique vertices 250 T = reshape(array(range(M)).astype(Int), (m,3)) 251 else: 252 T = self.triangles 253 254 return T 255 256 223 257 224 258 def get_unique_vertices(self, indexes=None):
Note: See TracChangeset
for help on using the changeset viewer.