smbinterp/bin/grid_regular.py

23 lines
459 B
Python
Executable File

#!/usr/bin/python
import sys
import pickle
from grid import simple_rect_grid, simple_random_grid
pfile = '/tmp/grid_regular.p'
qfile = '/tmp/grid_regular.txt'
if __name__ == '__main__':
try:
resolution = int(sys.argv[1])
if resolution > 200:
raise Exception
except:
resolution = 3
g = simple_rect_grid(resolution, resolution)
g.construct_connectivity()
open(qfile, 'w').write(g.for_qhull())
pickle.dump(g, open(pfile, 'w'))