edgeAttachments

Triangles or tetrahedra attached to given edges of a triangulation.

Category: Mathematics > Computational Geometry

Syntax

T = edgeAttachments(TR, v1, v2)

For each edge from vertex v1(i) to v2(i), lists the simplices that contain the edge.

T = edgeAttachments(TR, E)

The edges are given as the rows of the two-column matrix E.

Description

An interior edge of a planar mesh belongs to two triangles, an edge on the outline belongs to one. Looking at how many simplices come back therefore tells whether an edge is on the boundary. In a 3-D tetrahedral mesh an edge can be shared by many tetrahedra.

Input arguments

TR
A triangulation or delaunayTriangulation object.
v1, v2
Column vectors of vertex indices that define the edges.
E
Edges as a two-column matrix of vertex indices.

Output arguments

T
Cell array with one entry per edge, each a row vector of simplex indices. An edge that is not in the triangulation gives an empty entry.

Example

Triangles on two edges

x = [0 1 1 0 0.5]';
y = [0 0 1 1 0.5]';
DT = delaunayTriangulation(x, y);
ea = edgeAttachments(DT, [1 2; 2 3])
Output
ea = 2×1 cell

    {[2]}
    {[1]}

See also

edges freeBoundary isConnected triangulation