Refine one Element of a Triangulation

TRIANGULATION_REFINE_LOCAL is a MATLAB program which tries to locally refine a triangulation by replacing one triangular element by four smaller ones.

The refinement process introduces three new nodes, at the midsides of the original element. This, in turn, will create what is called "hanging nodes" on the neighboring elements, an undesirable feature. Therefore, each hanging node is used to divide the neighboring element into two new elements. This removes the hanging node problem.

Information about the triangulation is updated. In particular, the coordinates of the three new nodes are assigned indexes, and added to the node coordinate array. Four old elements are replaced by 10 new, smaller ones. This requires modifications to the element-node array and to the element-neighbor array.

This process of refinement does not take into account the shape of the new elements. The refinement process could create a new triangulation which no longer has the Delaunay property. If this is a concern, then a simple expedient is to retriangulate the nodes.

The program presented here presumed the triangulation involves order 3 elements, that the element-node array lists the nodes in counter-clockwise order, and that the element neighbor array indexes the element neighbors by the element node that is opposite to them. If any of these assumptions do not hold for the given data, the calculation will need to be modified.


The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.


TRIANGULATION_REFINE_LOCAL is available in a MATLAB version.

Related Data and Programs:

TABLE_DELAUNAY, a FORTRAN90 program which can read a file of point coordinates and construct the Delaunay triangulation for that set of points.

TRIANGLE, a C program which computes a triangulation of a geometric region.

TRIANGULATION, a MATLAB library which carries out various operations on order 3 ("linear") or order 6 ("quadratic") triangulations.

TRIANGULATION_BOUNDARY_EDGES, a MATLAB program which reads data defining a triangulation, determines which edges lie on the boundary, organizes them into connected components, and writes this information to a file.

TRIANGULATION_BOUNDARY_NODES, a MATLAB program which reads data defining a triangulation, determines which nodes lie on the boundary, and writes their coordinates to a file.

TRIANGULATION_CORNER, a MATLAB program which patches triangulations so that no triangle has two sides on the boundary.

TRIANGULATION_DELAUNAY_DISCREPANCY, a MATLAB program which measures the amount by which a triangulation fails the local Delaunay test;

TRIANGULATION_DISPLAY, a MATLAB program which displays the nodes and elements of a triangulation on the MATLAB graphics screen;

TRIANGULATION_ORDER3, a data directory which contains a description and examples of order 3 triangulations.

TRIANGULATION_ORIENT, a MATLAB program which reads data defining a triangulation, makes sure that every triangle has positive orientation, and if not, writes a corrected triangle file.

TRIANGULATION_PLOT, a MATLAB program which reads data defining a triangulation and creates a PostScript image of the nodes and triangles.

TRIANGULATION_QUALITY, a MATLAB program which reads data defining a triangulation and computes a number of quality measures.

TRIANGULATION_REFINE, a MATLAB program which refines a triangulation.

TRIANGULATION_TRIANGLE_NEIGHBORS, a MATLAB program which reads data defining a triangulation, determines the neighboring triangles of each triangle, and writes that information to a file.


  1. Marc deBerg, Marc Krevald, Mark Overmars, Otfried Schwarzkopf,
    Computational Geometry,
    Springer, 2000,
    ISBN: 3-540-65620-0.
  2. Joseph ORourke,
    Computational Geometry,
    Second Edition,
    Cambridge, 1998,
    ISBN: 0521649765,
    LC: QA448.D38.

Source Code:

Examples and Tests:

ELL3 is the original triangulation:

ELL3_REFINED is the triangulation after element 11 has been refined:

You can go up one level to the MATLAB source codes.

Last revised on 31 August 2011.