Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

triangles

Extract a list of triangles from a triangulation object


Description

This function extracts a triangulation data structure from an triangulation object created by tri.mesh.

The vertices in the returned matrix (let's denote it with retval) are ordered counterclockwise with the first vertex taken to be the one with smallest index. Thus, retval[i,"node2"] and retval[i,"node3"] are larger than retval[i,"node3"] and index adjacent neighbors of node retval[i,"node1"]. The columns trx and arcx, x=1,2,3 index the triangle and arc, respectively, which are opposite (not shared by) node nodex, with trix= 0 if arcx indexes a boundary arc. Vertex indexes range from 1 to N, triangle indexes from 0 to NT, and, if included, arc indexes from 1 to NA = NT+N-1. The triangles are ordered on first (smallest) vertex indexes, except that the sets of constraint triangles (triangles contained in the closure of a constraint region) follow the non-constraint triangles.

Usage

triangles(tri.obj)

Arguments

tri.obj

object of class "tri"

Value

A matrix with columns node1,node2,node3, representing the vertex nodal indexes, tr1,tr2,tr3, representing neighboring triangle indexes and arc1,arc2,arc3 reresenting arc indexes.

Each row represents one triangle.

Author(s)

A. Gebhardt

References

R. J. Renka (1996). Algorithm 751: TRIPACK: a constrained two-dimensional Delaunay triangulation package. ACM Transactions on Mathematical Software. 22, 1-8.

See Also

Examples

# use a slighlty modified version of data(tritest)
data(tritest2)
tritest2.tr<-tri.mesh(tritest2$x,tritest2$y)
triangles(tritest2.tr)

tripack

Triangulation of Irregularly Spaced Data

v1.3-9.1
ACM | file LICENSE
Authors
Fortran code by R. J. Renka. R functions by Albrecht Gebhardt <albrecht.gebhardt@aau.at>. With contributions from Stephen Eglen <stephen@anc.ed.ac.uk>, Sergei Zuyev <sergei@stams.strath.ac.uk> and Denis White <white.denis@epamail.epa.gov>
Initial release
2020-03-06

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.