moved the qhull generator into the base grid class

This commit is contained in:
Stephen Mardson McQuay
2011-03-21 15:24:25 -06:00
parent b83dd04e14
commit e856851f1e
2 changed files with 21 additions and 39 deletions
+21
View File
@@ -135,6 +135,27 @@ class grid(object):
answer = run_baker(X, R, S, order)
return answer
def for_qhull_generator(self):
"""
this returns a generator that should be fed into qdelaunay
"""
yield '3';
yield '%d' % len(self.verts)
for p in self.verts:
yield "%f %f %f" % tuple(p)
def for_qhull(self):
"""
this returns a single string that should be fed into qdelaunay
"""
r = '3\n'
r += '%d\n' % len(self.verts)
for p in self.verts:
r += "%f %f %f\n" % tuple(p)
return r
def __str__(self):
r = ''
assert( len(self.verts) == len(self.q) )