Plot a Triangulation from TRIANGLE Files

TRIANGLE_DISPLAY is a MATLAB program which plots a triangulation using files associated with Jonathan Shewchuk's triangle() program.

TRIANGLE_DISPLAY reads the node and element files created by the TRIANGLE program, and displays the information. The user controls how "visible" the nodes and elements are; in particular, nodes can be suppressed, or displayed, or displayed and numbered, and the same is true for elements.

TRIANGLE_DISPLAY is essentially a version of TRIANGULATION_DISPLAY modified to read input files that use the TRIANGLE format.

Jonathan Shewchuk provides a program called showme(), which is able to show the same information, and to perform other interesting operations. However, there are at least three reasons why the TRIANGLE_DISPLAY program is useful:


triangle_display ( 'prefix', node_vis, element_vis )
where 'prefix' is the common prefix for the node and element files. and node_vis is an integer defining the node visibility: and element_vis is an integer defining the element visibility:


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


TRIANGLE_DISPLAY is available in a MATLAB version.

Related Data and Programs:

FEM_BASIS_T3_DISPLAY, a MATLAB program which displays a basis function associated with a linear triangle ("T3") mesh.

FEM_BASIS_T6_DISPLAY, a MATLAB program which reads a quadratic triangle mesh and displays any associated basis function.

GRIDLINES, a MATLAB library which gives the user more control over drawing gridlines on a graph than the builtin "grid on" command.

MESH_DISPLAY, a MATLAB program which reads data defining a polygonal mesh and displays it, with optional numbering.

MPAS_GRID_DISPLAY, MATLAB programs which can read an MPAS NETCDF grid file and display the primary polygonal mesh or the dual triangular mesh.

PLY_DISPLAY, a MATLAB program which displays an image of a 3D graphics file in PLY format;

SHOWME, a C program which uses the X Window library to display triangulatons, by Jonathan Shewchuk.

TRI_SURFACE_DISPLAY, a MATLAB program which reads data defining a triangular mesh of a 3D surface and displays it.

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

TRIANGLE_FILES, a data directory of examples of files used by the triangle and showme programs.

TRIANGLE_IO, a MATLAB library which can read or write some of the files created by Jonathan Shewchuk's triangle() program.

TRIANGULATION_DISPLAY, a MATLAB program which reads files defining a triangulation and displays an image.

TRIANGULATION_DISPLAY_OPENGL, a C++ program which reads files defining a triangulation and displays an image using Open GL.

TRIANGULATION_PLOT, a MATLAB program which plots a triangulation as a PostScript file.


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

Source Code:

Examples and Tests:

GREENLAND is a triangulation of Greenland, using a graded (varying-size) mesh of 33,343 nodes and 64,125 nodes. The resulting image is essentially a red blob the shape of Greenland. However, using the ZOOM tool, it is possible to see interesting details of the mesh.

SQUARE_CIRCLE_HOLE.1 is a square region with a circular hole. 826 nodes and 1517 elements are used.

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

Last revised on 01 November 2010.