#!/usr/bin/python import sys import pickle from grid import simple_rect_grid, simple_random_grid pfile = '/tmp/grid_random.p' qfile = '/tmp/grid_random.txt' MAX_POINTS = 200 if __name__ == '__main__': sys.setrecursionlimit(4096) print sys.getrecursionlimit() try: total_points = int(sys.argv[1]) except: total_points = 10 if total_points > MAX_POINTS: print "too many points" sys.exit(1) g = simple_random_grid(total_points) g.construct_connectivity() print g open(qfile, 'w').write(g.for_qhull()) pickle.dump(g, open(pfile, 'w'))