Polygon triangulation demo

This page implementation a demo for a simple polygon triangulation algorithm. It shows how a sweep line algorithm, from bottom to top, from left to right, works. The green horizontal line indicates the height of the next point that will be processed. With the buttons 'more' and 'less' the number of steps can be increased and decreased respectively. During the sweep there will be zero or more valleys. Each valley is visualized with a red line following the lines of the polygon or the triangles with which the polygon is filled. Whenever there is room in a valley for triangles these are placed. The points of the triangles can be move when dragged with the mouse. But be carefull, the algorithm asumes that the polygons do not cross. If they do, this could lead to an incorrect triangulation. Please note that this algorithm does not result in a minimum-wieght triangulatetion. The text box below the buttons, explains the processing steps. Between the round brackets the previous and next points are mentioned. The numbers between braces are the points that are used to form a triangle. After the bar symbol the points in the valleys are displayed.


Home and email