Problem: Compute a conforming Delaunay triangulation of a set of boundaries and constraints
A 2d conforming Delaunay triangulation (CDT) is a true Delaunay triangulation in which each boundary or constraint may have been subdivided into several edges by the insertion of additional points. This allows the edges to exist in the triangulation while maintaining the Delaunay property.
A CDT must contain at least one of the following items:
- An arbitrary number of triangulation points, which will be vertices of the triangles in the CDT.
- An arbitrary number of unordered open or closed edges, called constraints, whose start and end points will be vertices of the triangles in the CDT. No edge of a triangle will cross a constraint. This is achieved by inserting additional triangulation points.
- An arbitrary number of unordered edges defining closed regions, called boundaries, whose start and end points will be vertices of the triangles in the CDT. No edge will cross a boundary. Boundaries allow for defining holes or islands in a triangulation by removing triangles with a simple ray tracing algorithm.
Restrictions:
- A CDT can not triangulate points, constraints or boundaries with identical X and Y coordinates. This is, vertical or recessing walls or "caves" can not be triangulated.
- Intersecting constraints and/or boundaries will cause unpredictable results at the intersection points.
- The boundary edges must define an arbitrary number of closed regions or the ray tracing algorithm will fail.
The algorithm does not recheck if the boundaries or constraints intersect, nor does it recheck if the boundaries define closed regions.
The following example is a CDT of the Chiemsee lake in Bavaria. It has the two islands Herrenchiemsee and Frauenchiemsee.
Solution using G#
- public static void ConformingDelaunay()
- {
- ConformingDelaunayTriangulation2d ground =
- ground.Boundaries.AddRange(Chiemsee.Lake()); //The lake
- ground.Boundaries.AddRange(Chiemsee.HerrenChiemsee());//Herrenchiemsee island
- ground.Boundaries.AddRange(Chiemsee.FrauenChiemsee());//Frauenchiemsee island
- ground.Triangulate();
- ConformingDelaunayTriangulation2d water =
- water.Boundaries.AddRange(Chiemsee.Lake()); //The lake
- water.Boundaries.AddRange(Chiemsee.HerrenChiemsee());//Herrenchiemsee island
- water.Boundaries.AddRange(Chiemsee.FrauenChiemsee());//Frauenchiemsee island
- water.Triangulate();
- sc.Add(ground.GetTriangles(), groundLayer);
- sc.Add(water.GetTriangles(), waterLayer);
- sc.Add(ground.Constraints, boundaryLayer);
- sc.Add(ground.Boundaries, boundaryLayer);
- sc.WriteDxf(@"c:\conforming_delaunay.dxf");
- Console.WriteLine("Done!");
- Console.ReadLine();
- }




