Line | |
---|
1 | #!/usr/bin/python |
---|
2 | """ |
---|
3 | Script to thin out the number of vertices in an xya file. |
---|
4 | Put's a square mesh over the domain and then only keeps |
---|
5 | one vertice in each square. |
---|
6 | """ |
---|
7 | import os, sys |
---|
8 | sys.path.append('..') |
---|
9 | from mesh import * |
---|
10 | |
---|
11 | usage = "usage: %s file_name square_length" % os.path.basename(sys.argv[0]) |
---|
12 | |
---|
13 | if len(sys.argv) < 3: |
---|
14 | print usage |
---|
15 | else: |
---|
16 | file_name_path= sys.argv[1] |
---|
17 | square_length= float(sys.argv[2]) |
---|
18 | wallis_name = file_name_path[:-4] + "_" + str(square_length) + ".xya" |
---|
19 | m = loadxyafile(file_name_path," ") |
---|
20 | m.thinoutVertices(square_length) |
---|
21 | print "Saving file " + wallis_name + "." |
---|
22 | m.exportxyafile(wallis_name) |
---|
Note: See
TracBrowser
for help on using the repository browser.