Shapes & spaces

Constrained Delaunay triangulation calculator for polygons with holes

Triangulate a planar polygonal domain with holes while preserving boundary edges and enforcing a local constrained Delaunay condition.

Your numbers

Enter finite values within the stated bounds; coordinate rows may use commas.
Separate holes with a blank line. Enter none for no holes.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

Triangulate a planar polygonal domain with holes while preserving boundary edges and enforcing a local constrained Delaunay condition.

THE FORMULAT=n+2h−2; Σ triangle areas=outer area−Σ hole areas.

A worked example

A4×4 square with a1×1 square hole has15 square units of area and eight boundary-vertex triangles.

Good to know

One simple outer ring and0–3 disjoint, nonnested holes, at most40 vertices total. No touching constraints, duplicate vertices or Steiner refinement. Floating planar predicates; degenerate or failed area/Euler checks rejected.

A domain with material removed

A hole changes which part of a polygon is available for triangulation. The outer boundary encloses material, while each inner ring removes its interior. Connecting every boundary vertex as if there were no holes would create triangles across empty space and overstate the domain area.

This calculator retains all boundary segments and adds diagonals only inside the remaining domain. It then flips eligible internal edges toward the constrained Delaunay condition. The output is a mesh of the entered region, not a triangulation of the convex hull of all coordinates.

Square domain with a square holeOuter area = 16Hole area = 18 triangles, area = 15
Scroll across to see the full diagram.
Eight triangles cover the15-square-unit domain; the inner square remains empty.

Compare this with the Concave polygon triangulation calculator from vertices. Triangulate a multiply connected polygonal domain while retaining boundary constraints and testing unconstrained local Delaunay edges.

Preparing the boundary rings

Enter the outer polygon in boundary traversal order. Enter each hole as a separate block, with a blank line between blocks; use none when there are no holes. The implementation normalizes ring orientation, so clockwise input alone does not change which ring is treated as material.

Rings must be simple, nonintersecting and mutually separated. Every hole must lie strictly inside the outer boundary, and holes must not contain one another. Duplicate coordinates or a segment passing through an unrelated boundary vertex make the intended constraint graph ambiguous and should be repaired first.

The square-with-a-hole example

The default outer ring is the square from zero to four on both axes. Its area is sixteen. The inner square has corners at one and two, so it removes one square unit and leaves fifteen. Eight distinct boundary vertices participate in the triangulation.

With no extra interior vertices, a connected polygonal domain with n boundary vertices and h holes has n plus two h minus two triangles. Substituting eight vertices and one hole gives eight triangles. The calculator checks this count as well as the sum of their signed geometric areas.

From visible diagonals to triangles

The construction begins with the fixed ring edges. Candidate diagonals must remain inside the domain, avoid unrelated boundary vertices and not cross a constraint. A length-ordered noncrossing insertion creates a maximal planar subdivision, from which consistently oriented triangular faces are extracted.

Internal edges shared by two triangles are then considered for a flip. A flip is allowed only when the two faces form a convex quadrilateral and their shared edge is not constrained. The circumcircle determinant decides whether replacing that diagonal improves the local Delaunay relation.

What constrained Delaunay promises

An unconstrained Delaunay triangulation asks for empty circumcircles. Boundary segments can obstruct visibility and force edges that would otherwise be undesirable. The constrained condition therefore applies to allowable internal flips while preserving the polygon and hole boundaries as exact combinatorial requirements.

This is not a mesh-refinement service. No new points are inserted to guarantee a chosen minimum angle or maximum element area. A narrow corridor or sharp boundary corner can still produce thin triangles, because every valid mesh must honor the entered geometry before improving element shape.

Inspecting connectivity and area

Each reported triangle is a triple of indices into the returned normalized vertex list. Use that list rather than assuming the original hole traversal survived unchanged. Boundary constraints should appear once among triangle edges; an ordinary internal edge should have two incident triangles.

The area residual measures whether triangle areas reproduce outer area minus holes. The Euler triangle-count check catches missing or extra faces that a small residual alone might miss. Both are necessary consistency checks, but neither turns floating circumcircle tests into formal exact predicates near a degenerate configuration.

Choosing the next calculation

Use the triangles for a small planar domain, inspection drawing or educational finite-element setup. Before numerical integration or simulation, also examine triangle angles, physical boundary conditions and the meaning of coordinate units. A visually plausible triangulation does not specify a differential equation or its material properties.

If boundaries touch, self-intersect or nearly coincide, fix their topology before requesting another mesh. Increasing the number of vertices does not resolve an ambiguous domain. For difficult geometry requiring rigorous predicates or adaptive refinement, a dedicated constrained-meshing package is the appropriate next step.

A few questions, answered

Can the polygon be concave?

Yes, provided the outer boundary is simple and all holes remain disjoint and strictly inside it.

Are new vertices inserted?

No. This bounded construction uses the supplied boundary vertices and does not perform quality refinement.

Why did hole vertex indices change?

Ring orientation is normalized. Read triangle indices against the returned vertex list.

Does Delaunay guarantee well-shaped triangles?

No. Constrained sharp corners and narrow gaps can force thin triangles without additional refinement.

Find your calculator

Start typing to explore the library.