Ticket #61 (new enhancement)

Opened 2 months ago

Delaunay cannot triangulate a jittered grid

Reported by: pv Assigned to: rkern
Priority: minor Milestone:
Component: delaunay Version:
Keywords: Cc:

Description

scikits.delaunay cannot triangulate the following grid:

>>> import scikits.delaunay as d
>>> import numpy as np
>>> data = np.array([
...     [-1, -1                          ], [-1, 0], [-1, 1],
...     [ 0, -1                          ], [ 0, 0], [ 0, 1],
...     [ 1, -1 - np.finfo(np.float_).eps], [ 1, 0], [ 1, 1],
... ])
>>> tri = d.Triangulation(data[:,0], data[:,1])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/stow/python-easy-install/lib/python2.5/site-packages/scikits.delaunay-0.5-py2.5-linux-i686.egg/scikits/delaunay/triangulate.py", line 90, in __init__
    self.hull = self._compute_convex_hull()
  File "/usr/local/stow/python-easy-install/lib/python2.5/site-packages/scikits.delaunay-0.5-py2.5-linux-i686.egg/scikits/delaunay/triangulate.py", line 125, in _compute_convex_hull
    hull.append(edges.pop(hull[-1]))
KeyError: 6

... as discussed in http://thread.gmane.org/gmane.comp.python.scientific.user/14720/focus=14744

(Moved here from scipy ticket #376).