MESH2D: Delaunay-based unstructured mesh-generation

Generate unstructured meshes for general two-dimensional geometries.
Updated 2 Mar 2024

MESH2D is a MATLAB-based Delaunay mesh-generator for two-dimensional geometries. It is designed to generate high-quality constrained Delaunay triangulations for general polygonal regions in the plane. MESH2D provides simple and yet effective implementations of "Delaunay-refinement" and "Frontal-Delaunay" triangulation techniques, in additional to "hill-climbing" type mesh-optimisation. Support for user-defined "mesh-spacing" functions and "multi-part" geometry definitions are provided, allowing varying levels of mesh-resolution to be specified within complex domains. Algorithms implemented in MESH2D are "provably-good" - ensuring convergence, geometrical and topological correctness, and providing guarantees on algorithm termination and worst-case element quality bounds. MESH2D typically generates very high-quality output, appropriate for a variety of finite-volume/element type applications.

See TRIDEMO to get started with a set of example problems:

tridemo(0); % a very simple example to get everything started.
tridemo(1); % investigate the impact of the "radius-edge" threshold.
tridemo(2); % Frontal-Delaunay vs. Delaunay-refinement algorithms.
tridemo(3); % explore impact of user-defined mesh-size constraints.
tridemo(4); % explore impact of "hill-climbing" mesh optimisations.
tridemo(5); % assemble triangulations for "multi-part" geometries.
tridemo(6); % assemble triangulations with "internal" constraints.
tridemo(7); % investigate the use of "quadtree"-type refinement.
tridemo(8); % explore use of custom, user-defined mesh-size functions.
tridemo(9); % larger-scale problem, mesh refinement + optimisation.
tridemo(10); % medium-scale problem, mesh refinement + optimisation.

Additional information and references are available via the GitHub repository:

MESH2D is a simplified version of my three-dimensional mesh-generation algorithm JIGSAW, providing an implementation of "provably-good" Delaunay-refinement and Frontal-Delaunay triangulation techniques. JIGSAW is available here:

MESH2D also makes use of my AABBTREE and FINDTRIA packages to compute efficient spatial queries and intersection tests. See and for details.

Cite As

D. Engwirda, Locally-optimal Delaunay-refinement and optimisation-based mesh generation, Ph.D. Thesis, School of Mathematics and Statistics, The University of Sydney,, 2014.

D. Engwirda, Unstructured mesh methods for the Navier-Stokes equations, Honours Thesis, School of Aerospace, Mechanical and Mechatronic Engineering, The University of Sydney, 2005.

MATLAB Release Compatibility
Created with R2018b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Versions that use the GitHub default branch cannot be downloaded

Version Published Release Notes

Website updates.

Updates to description/references.
Improved support for OCTAVE.

Updates to the underlying AABB-Tree package.

Updates to 3.0.2: added TRIDIV2, improved REFINE2 / SMOOTH2, new examples in TRIDEMO.

Update project title.

Major updates all-round for MESH2D - 3.0.0.

To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.