mostly fixed a bug in my qdelaunay parsing. implemented a blender viewer ... mostly
the qdelaunay app doesn't alway display all faces for a point. lame. I worked around it by creating the point-> face relationships manually. There is a max recursion something happeneing when I try to save so pickle. look into this. I spent some time writing a visualizer for blender. 10 lines of code. simple stuff. next steps would be to move the KDTree into the mesh object. GOOD LUCK (me)!! --HG-- rename : bin/grid_driver.py => bin/grid_random.py rename : bin/grid_driver.py => bin/grid_regular.py
This commit is contained in:
@@ -1,16 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import sys
|
||||
|
||||
from grid import simple_rect_grid
|
||||
from smcqdelaunay import get_qdelaunay_dump_str
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
resolution = int(sys.argv[1])
|
||||
except:
|
||||
resolution = 3
|
||||
g = simple_rect_grid(resolution, resolution)
|
||||
s = get_qdelaunay_dump_str(g)
|
||||
g.construct_connectivity(s)
|
||||
print g
|
||||
Executable
+28
@@ -0,0 +1,28 @@
|
||||
#!/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'))
|
||||
Executable
+22
@@ -0,0 +1,22 @@
|
||||
#!/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'))
|
||||
Reference in New Issue
Block a user