davidalber/Sandbox — Issue #2: Delaunay: n=3 list index out of range
Author: davidalber
Created: 2011-11-18 06:26:31+00:00
State: open

When running:

delaunay -n 3 --no-plot --summary -s 1

The following exception is raised.

```python
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/Current/bin/delaunay", line 9, in
load_entry_point('Algbox==0.1', 'console_scripts', 'delaunay')()
File "/Users/David/fun/Algbox/src/algbox/__init__.py", line 4, in do_delaunay
return delaunay.delaunay()
File "/Users/David/fun/Algbox/src/algbox/delaunay.py", line 351, in delaunay
d.triangulation()
File "/Users/David/fun/Algbox/src/algbox/delaunay.py", line 44, in triangulation
middle_point = self.initial_triangles_from_hull()
File "/Users/David/fun/Algbox/src/algbox/delaunay.py", line 133, in initial_triangles_from_hull
if self.check_and_flip(key):
File "/Users/David/fun/Algbox/src/algbox/delaunay.py", line 146, in check_and_flip
angle2 = self.get_angle(tri2, list(set(tri2)-set(shared_edge))[0])
IndexError: list index out of range
```