Declaration
public static IEnumerable<ValueTuple<int, int>> DelaunayEdgesConstrained(
List<PointD> vertices,
HashSet<ValueTuple<int, int>> requiredEdges,
Dictionary<ValueTuple<int, int>, ValueTuple<int, int>> splitEdges = null
)Summary
Generates a Delaunay triangulation of the input points. Ensures that
requiredEdges are all
present in the triangulation, by inserting new vertices as necessary.
Parameters
| List<PointD> | vertices |
Input points to triangulate. Must not contain duplicates. New vertices are added in place at the end of the
list. |
| HashSet<ValueTuple<int, int>> | requiredEdges |
Edges that must be present in the triangulation. This constraint is achieved by splitting required edges, which
updates this set in place. Expects a single pair per edge, in any order. Required edges must not intersect. |
| Dictionary<ValueTuple<int, int>, ValueTuple<int, int>> | splitEdges |
Optional empty dictionary which gets populated as a lookup from each final split edge to the corresponding
original required edge. |
Returns
A list of edges in the triangulation, as pairs of indices into
vertices. The indices within
each pair, as well as the pairs themselves, are ordered arbitrarily.
Remarks
Does not guarantee that the set of new vertices is minimal. This is not a fast way to perform constrained
triangulation.