How this calculation works
Refine a polygon triangulation by inserting Steiner vertices until the stated edge-size and triangle-shape criteria pass.
shape ratio = circumradius / shortest edge; split encroached segments before inserting circumcentersA worked example
A square of side two has a diagonal of length square root of eight. Its initial two-triangle mesh fails a maximum edge size of one, so additional vertices are required.
Good to know
Simple polygon at most12 boundary vertices, no holes initially, input corner angles at least60 degrees, circumradius/shortest-edge threshold greater than sqrt(2), positive maximum edge size and 500 inserted-vertex cap. Encroachment-aware segment splitting and circumcenter refinement; cap is unresolved, not successful quality attainment.
Reference: CGAL 2D Conforming Triangulations and Meshes (opens in a new tab) ↗
Quality refinement adds new vertices
A constrained triangulation connects the supplied polygon vertices while respecting boundary segments. Quality refinement goes further: it inserts Steiner vertices to improve triangle shape or size. The final mesh therefore contains positions that were not part of the original input, and its connectivity is not simply a different diagonal choice on the same vertex set.
This distinction matters when counting elements or comparing meshes. A valid constrained Delaunay triangulation can still contain large or poorly shaped triangles. Conversely, a refined mesh may use more elements while better resolving the intended domain. The objective is to satisfy explicit criteria, not to minimize triangle count or approximate the boundary with a different polygon.
Compare this with the Constrained Delaunay triangulation calculator for polygons with holes. Generate additional Steiner vertices to meet triangle quality and size criteria; existing constrained triangulation preserves the supplied vertex set and does not solve quality meshing.
Reading the shape and size criteria
The shape criterion compares a triangle circumradius with its shortest edge. A large ratio signals a skinny triangle. The supplied upper threshold states the allowed shape quality. The separate maximum-edge criterion limits geometric size, so a nearly equilateral but very large triangle can still require refinement.
These two tests should not be conflated with a minimum area or aspect-ratio definition from another package. Several quality metrics are used in meshing, and their numerical thresholds are not interchangeable. Inspect the actual circumradius, shortest edge and longest edge for each returned triangle before claiming that the chosen criteria were satisfied.
Why boundary angles restrict the domain
The initial supported polygon has no holes and has boundary corner angles of at least sixty degrees. The shape threshold is greater than square root of two. These restrictions follow a conservative termination regime for the refinement method; they avoid promising arbitrary quality around an input corner whose geometry already forces a small angle.
An acute boundary corner cannot be removed without changing the input domain. If an input lies outside the declared angle regime, the calculator should reject it or use a separately documented method. Continuing with relaxed criteria while still displaying the original thresholds would give a misleading success status, particularly near corners where bad elements tend to accumulate.
Splitting segments before circumcenters
A bad triangle suggests its circumcenter as a new vertex. Before inserting that point, test whether it encroaches on a constrained boundary segment according to the chosen protection rule. An encroached segment is split first, preventing an interior insertion from undermining the boundary constraints or causing an uncontrolled local refinement cascade.
After each insertion, update the constrained Delaunay structure and reconsider affected triangles. Boundary subsegments must still cover every original segment exactly. This sequence produces a geometric certificate that differs from merely running a generic triangulator again with a denser arbitrary point grid. The location and reason for each insertion can be retained as an inspectable history.
The square example
The default square has vertices at zero and two along both coordinate axes. Any initial triangulation through one diagonal contains that diagonal as an edge of length square root of eight. With maximum edge length one, this is already enough to establish that the coarse mesh fails the requested size criterion.
The refinement must create additional points and triangles. Its exact vertex count can depend on admissible insertion choices and tie handling, so the example does not assert a unique final mesh. Instead, verify that the returned mesh covers the square area four, preserves the four boundary segments through their subdivisions, and has every accepted edge and triangle within the displayed bounds.
Checking a completed mesh
A successful result must pass topology, boundary, coverage and quality checks together. Check triangle orientations, overlapping interiors, total area and the representation of every boundary subsegment. Then evaluate the actual shape and size criteria on every final triangle, rather than infer success from the number of inserted points or an attractive drawing.
A solver can stop because it reaches an insertion cap, encounters an unresolved geometric degeneracy or genuinely satisfies the criteria. Those outcomes are different. Only the last one supports a quality-attainment claim. Preserve failing triangles and their measured ratios when stopping early, so the user can see whether a smaller size request or near-degenerate configuration caused the difficulty.
Limits of the educational mesh model
The bounded implementation supports a small polygon and a capped number of insertions. It is intended to explain Delaunay refinement, not to replace an industrial mesher for millions of elements. It also does not adapt element sizes to a partial differential equation residual, a stress field or a spatially varying anisotropic metric.
A finer mesh alone does not establish that a later finite-element solution is accurate. That requires the governing equations, boundary conditions and an appropriate error analysis. Use the returned insertion history and explicit criteria to understand the geometric step. Keep later simulation accuracy separate from the question of whether these particular mesh-quality conditions were met.
A few questions, answered
Will the output contain new points?
Yes. Steiner insertion is the essential difference from triangulating only the supplied vertices.
Does more triangles always mean better quality?
No. Every returned triangle must be measured against the stated shape and size criteria.
Why reject a sharp input corner?
The conservative supported termination regime excludes corners that inherently obstruct the requested quality guarantee.
Does hitting the insertion cap count as success?
No. It is an unresolved refinement, with remaining failing elements reported.