vertexAttachments

Lists the triangles or tetrahedra attached to given vertices.

Category: Mathematics > Computational Geometry

Syntax

ID = vertexAttachments(TR, vi)

Returns, for each vertex index in vi, the elements that use that vertex.

Description

The result answers the question of which triangles touch a given point. It is the inverse view of the connectivity list, which instead says which vertices form each triangle. A vertex on the border of the mesh is attached to fewer elements than an interior one.

Input arguments

TR
A triangulation object.
vi
Vertex indices (a vector). If omitted, all vertices are used.

Output arguments

ID
Cell array with one row vector per vertex, holding indices of the elements (rows of the connectivity list) that contain that vertex.

Example

Triangles around a vertex

P = [0 0; 1 0; 1 1; 0 1];
T = [1 2 3; 1 3 4];
TR = triangulation(T, P);
ID = vertexAttachments(TR, 1);
disp(ID{1})
Output
     1     2

See also

triangulation neighbors vertexNormal pointLocation