smbinterp/interp/grid/delaunay.py
Stephen M. McQuay 1af176a6e0 Primarily: fixed the gmsh module to use integer indices
also did some pep8/pyflakes cleanup
2011-09-27 15:23:42 -06:00

16 lines
430 B
Python

import scipy.spatial
from interp.grid import grid as basegrid
class dgrid(basegrid):
def __init__(self, points, values):
self.points = points
self.values = values
self.triangulation = scipy.spatial.Delaunay(points)
self.simplices = self.triangulation.vertices
self.tree = scipy.spatial.KDTree(points)
def find_simplex(self, X):
return self.triangulation.find_simplex(X)