Programming Assignment 1
Due date: October 01, 2014, 11:59pm
- Goal: Implement Hertel and Mehlhorn Algorithm using Ear-clipping Triangulation
- Input: A polygon
- Explain polygon file format
- Output: A list of convex polygons
- Code: CS499-PA1.7z
- How to submit
- email me a link that I can download all source code in a file named cs499_pa1_[your last name].zip
- Please do not send me the file directly
Assignment details
In this assignment, you will implement tHertel and Mehlhorn Algorithm using Ear-clipping Triangulation described in Chapters 1 and 2 of the textbook. Here is a more detailed list of your tasks
- Make sure that you understand the algorithms and the skeleton code, esp. classes in polygon.h
- The EAR-clipping triangulate function should be implemented in triangulation.cpp
- Chapter 1 should provide you most of the source code already...
- intersection.h should contain some helpful functions.
- Vertices in the polygon are ordered counter clockwise. Convex polygons created by your function should also be ordered counter clockwise.
- Save each convex polygon in its own file
- If the input filename is "polygon.poly" and if there are 3 convex components in your decomposition, then the output files should be named "polygon_cc_000001.poly", "polygon_cc_000002.poly", and "polygon_cc_000003.poly". There are six digits between "polygon_cc_" and ".poly"
To compile the skeleton code
Just type make (on Unix-like system of course)
If you use Visual Studio please create your own solution files.
Currently there is only text output. I may provide a visualization tool later. But that is a big "may".