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:
Stephen Mardson McQuay
2010-02-14 20:56:41 -07:00
parent 9ff48f4c12
commit 2cf9a0b574
6 changed files with 87 additions and 26 deletions
-16
View File
@@ -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
+28
View File
@@ -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'))
+22
View File
@@ -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'))