Saint Louis University |
Computer Science 493
|
Dept. of Math & Computer Science |
Topic: Computing the Delaunay Triangulation
Related Reading: Ch. 9
Due:
Monday, 3 December 2007
Please make sure you adhere to the policies on academic integrity.
Implement the algorithm described in Chapter 9 of our text book. However, please do not shuffle the original point set; insert points in the order given. The randomization is important for the general analysis, but it will be easier to test your software by using a fixed order.
Your goal is to implement the function
def computeDelaunay(points, animationWidth=None): """Return a DCEL representing the delaunay triangulation of given container of Points. animationWidth is the width of a canvas for animation (default None designates no animaion) """in the file delaunay.py. By default, you are not responsible for any graphics. So long as you return a valid DCEL instance, our driver will render the final result. However, for a more impressive program, animate the construction as you go in a separate canvas of width animateWidth.
Repository: source code
Our driver is similar to the convex hull one in that it lets you either specified a fixed point set from an input file, or to generate one randomly. Usage is:
python driver.py [inputfile] [animationWidth]
These are examples of the final DCEL images (that is, the result after stripping away the outer bounding triangle from the construction algorithm).
A single input point | |
Two input points | |
Four points lying on a common circle | |
from left side of page 193 of our text | |
from right side of page 193 of our text | |
from O'Rourke text (page 190) | |
Data set with degeneracies |