Triangulate a planar straight line graph using the Triangle
library (http://www.cs.cmu.edu/~quake/triangle.html). The
triangulation is a constrained conforming Delaunay triangulation
in which additional vertices, called Steiner points, can be
inserted into segments to improved the quality of the
triangulation. To prevent the insertion of Steiner points on
boundary segments, specify Y=1
. If the maximum triangle
area a
is specified, the area of each triangle is not
allowed to exceed this value. If the the minimum angle q
is
specified, no triangle angle is allowed to be below this value.
1 2 
p 
Planar straight line graph object; see

a 
Maximum triangle area. If specified, triangles cannot be larger than this area. 
q 
Minimum triangle angle in degrees. 
Y 
If 
j 
If 
D 
If 
S 
Specifies the maximum number of added Steiner points. 
V 
Verbosity level. Specify higher values for more detailed information about what the Triangle library is doing. 
Q 
If 
A object with class triangulation
. This contains
the information in the same format as the PSLG, p
, with an
updated list of points P
and point attributes PA
,
along with the following variables:

Triangulation specified as 3 column matrix
in which each row contains indices in 

Set of edges in the triangulation. 

Boundary markers of edges. For each edge this is 1 if the point is on a boundary of the triangulation and 0 otherwise. 

The points of the Voronoi tessalation as a 2column matrix 

Set of edges of the Voronoi tessalation. An index of 1 indicates an infinite ray. 

Directions of infinite rays of Voroni tessalation as a 2column matrix with the same number of rows as 

Matrix of attributes associated with the polygons of the Voronoi tessalation. 
David Sterratt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28  ## Create an object with a concavity
p < pslg(P=rbind(c(0, 0), c(0, 1), c(0.5, 0.5), c(1, 1), c(1, 0)),
S=rbind(c(1, 2), c(2, 3), c(3, 4), c(4, 5), c(5, 1)))
## Plot it
plot(p)
## Triangulate it
tp < triangulate(p)
plot(tp)
## Triangulate it subject to minimum area constraint
tp < triangulate(p, a=0.01)
plot(tp)
## Load a data set containing a hole
A < read.pslg(file.path(system.file(package = "RTriangle"), "extdata", "A.poly"))
plot(A)
## Produce a constrained Delaunay triangulation of the PSLG
tA < triangulate(A, Y=TRUE)
plot(tA)
## Produce a conforming Delaunay triangulation of the PSLG
tA < triangulate(A, D=TRUE)
plot(tA)
## Triangulate the PSLG with triangles in which no angle
## is smaller than 20 degrees
tA < triangulate(A, q=20)
plot(tA)
## Triangulate the PSLG with triangles in which no triangle has
## area greater than 0.001
tA < triangulate(A, a=0.001)
plot(tA)

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
Please suggest features or report bugs with the GitHub issue tracker.
All documentation is copyright its authors; we didn't write any of that.