TriangleTriangulate
TriangleTriangulate[expr,settings]
triangulates a Triangle expression using settings and returns the result in a new Triangle expression.
Details and Options
- To use TriangleTriangulate, you first need to load it using Needs["TriangleLink`"].
- The settings given to TriangleTriangulate are a string of different commands:
-
"p" triangulate a planar straight line graph (PLC) "q" quality mesh generation with no angles smaller than 20 degrees; an alternate minimum angle may be specified after the "q" "a" impose a maximum triangle area constraint; a fixed area constraint (that applies to every triangle) may be specified after the "a" "A" assign a regional attribute to each triangle that identifies what segment-bounded region it belongs to "c" enclose the convex hull with segments "D" conforming Delaunay: if all triangles in the mesh are to be Delaunay, not just constrained Delaunay, or if you want to ensure that all Voronoi vertices lie within the triangulation "r" refine a previously generated mesh "Y" prohibit the insertion of Steiner points on the mesh boundary; if specified twice ("YY"), it prohibits the insertion of Steiner points on any segment, including internal segments "S" specify the maximum number of added Steiner points "o2" generate second-order subparametric elements with six nodes each "C" check the consistency of the final mesh "Q" quiet: no terminal output except error - TriangleTriangulate has the following options:
-
"TriangleRefinement" None function to refine a triangle
Examples
open allclose allBasic Examples (1)Summary of the most common use cases

https://wolfram.com/xid/0iwilmq127916721ou0-fxs7lh
This creates an instance of a Triangle expression:

https://wolfram.com/xid/0iwilmq127916721ou0-o1426k

This sets up points and segments to use:

https://wolfram.com/xid/0iwilmq127916721ou0-m4mik5
This sets the points and facets in the Triangle instance:

https://wolfram.com/xid/0iwilmq127916721ou0-njb7qi
This carries out the triangulation, returning a new Triangle instance:

https://wolfram.com/xid/0iwilmq127916721ou0-zylv5s

This extracts the points and elements from the triangulation:

https://wolfram.com/xid/0iwilmq127916721ou0-vyvwtg
With the following support function, you can visualize the triangles:

https://wolfram.com/xid/0iwilmq127916721ou0-zl8tzc

https://wolfram.com/xid/0iwilmq127916721ou0-oo6mjk

Options (1)Common values & functionality for each option
"TriangleRefinement" (1)

https://wolfram.com/xid/0iwilmq127916721ou0-z5cchz
This creates an instance of a Triangle expression:

https://wolfram.com/xid/0iwilmq127916721ou0-66d747

This sets up points and segments to use:

https://wolfram.com/xid/0iwilmq127916721ou0-l6hmwy
This sets the points and facets in the Triangle instance:

https://wolfram.com/xid/0iwilmq127916721ou0-6o8a0u
This carries out the triangulation, returning a new Triangle instance:

https://wolfram.com/xid/0iwilmq127916721ou0-i8enpi

This extracts the points and elements from the triangulation:

https://wolfram.com/xid/0iwilmq127916721ou0-hqh1dz
With the following support function, you can visualize the triangles:

https://wolfram.com/xid/0iwilmq127916721ou0-m0ro2h

https://wolfram.com/xid/0iwilmq127916721ou0-zzr3vl

This sets up a compiled function that returns True if a triangle should be refined and False otherwise:

https://wolfram.com/xid/0iwilmq127916721ou0-vvqbsi
This carries out the triangulation with the refinement function, returning a new Triangle instance:

https://wolfram.com/xid/0iwilmq127916721ou0-ym9gaq

This extracts the points and elements from the triangulation:

https://wolfram.com/xid/0iwilmq127916721ou0-2y6u3q

https://wolfram.com/xid/0iwilmq127916721ou0-hgmqx4

Neat Examples (1)Surprising or curious use cases
Use a black-and-white image as a refinement driver. Set an image, create a distance function, and visualize the distance function:

https://wolfram.com/xid/0iwilmq127916721ou0-yj81es

https://wolfram.com/xid/0iwilmq127916721ou0-mnsz6i

https://wolfram.com/xid/0iwilmq127916721ou0-or4rub

Create an InterpolatingFunction from the distance function:

https://wolfram.com/xid/0iwilmq127916721ou0-vcenyz

Create and populate a Triangle instance:

https://wolfram.com/xid/0iwilmq127916721ou0-25bouh
Set up a compiled function that calls the InterpolatingFunction:

https://wolfram.com/xid/0iwilmq127916721ou0-iqhren
This carries out the triangulation with the refinement function, returning a new Triangle instance:

https://wolfram.com/xid/0iwilmq127916721ou0-64t9r7

This extracts the points and elements from the triangulation:

https://wolfram.com/xid/0iwilmq127916721ou0-dosgxu

https://wolfram.com/xid/0iwilmq127916721ou0-rbqeb

Wolfram Research (2014), TriangleTriangulate, Wolfram Language function, https://reference.wolfram.com/language/TriangleLink/ref/TriangleTriangulate.html.
Text
Wolfram Research (2014), TriangleTriangulate, Wolfram Language function, https://reference.wolfram.com/language/TriangleLink/ref/TriangleTriangulate.html.
Wolfram Research (2014), TriangleTriangulate, Wolfram Language function, https://reference.wolfram.com/language/TriangleLink/ref/TriangleTriangulate.html.
CMS
Wolfram Language. 2014. "TriangleTriangulate." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/TriangleLink/ref/TriangleTriangulate.html.
Wolfram Language. 2014. "TriangleTriangulate." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/TriangleLink/ref/TriangleTriangulate.html.
APA
Wolfram Language. (2014). TriangleTriangulate. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/TriangleLink/ref/TriangleTriangulate.html
Wolfram Language. (2014). TriangleTriangulate. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/TriangleLink/ref/TriangleTriangulate.html
BibTeX
@misc{reference.wolfram_2025_triangletriangulate, author="Wolfram Research", title="{TriangleTriangulate}", year="2014", howpublished="\url{https://reference.wolfram.com/language/TriangleLink/ref/TriangleTriangulate.html}", note=[Accessed: 16-May-2025
]}
BibLaTeX
@online{reference.wolfram_2025_triangletriangulate, organization={Wolfram Research}, title={TriangleTriangulate}, year={2014}, url={https://reference.wolfram.com/language/TriangleLink/ref/TriangleTriangulate.html}, note=[Accessed: 16-May-2025
]}