Main Content

edgeAttachments

(Not recommended) Triangles or tetrahedra attached to specified edge

edgeAttachments(TriRep) is not recommended. Use edgeAttachments(triangulation) instead.

TriRep is not recommended. Use triangulation instead.

Description

SI = edgeAttachments(TR,V1,V2) returns the simplices SI attached to the edges specified by (V1,V2). (V1,V2) represent the start and end vertices of the edges to be queried.

example

SI = edgeAttachments(TR,EDGE) specifies edges in matrix format.

example

Examples

collapse all

Load a 3-D triangulation to compute the tetrahedra attached to specified edges.

load tetmesh
trep = TriRep(tet,X);
v1 = [15 21]';
v2 = [936 716]';
t1 = edgeAttachments(trep,v1,v2)
t1=2×1 cell array
    {[927 2060 3438 3423 2583 4690]}
    {[    2652 3946 3953 4665 4218]}

Alternatively, you can specify the inputs with an edges matrix.

e = [v1 v2];
t2 = edgeAttachments(trep,e);
isequal(t1,t2)
ans = logical
   1

Create a triangulation with DelaunayTri.

x = [0 1 1 0 0.5]';
y = [0 0 1 1 0.5]';
dt = DelaunayTri(x,y);

Query the triangles attached to edge (1,5).

t = edgeAttachments(dt,1,5);
t{:}
ans = 1×2

     4     1

Input Arguments

collapse all

Triangulation representation, specified as a TriRep or DelaunayTri object.

Vertex coordinates, specified as column vectors. V1 and V2 specify vertex indices into the array of points representing the vertex coordinates. (V1,V2) represent the start and end vertices of the edges to be queried.

Vertex coordinates, specified as a matrix. EDGE specifies the start and end vertices of the edges to be queried. EDGE is of size m-by-2, with m being the number of edges to query.

Output Arguments

collapse all

Attached simplices, returned as a cell array of indices into the triangulation matrix. SI is a cell array because the number of simplices associated with each edge can vary.

More About

collapse all

Simplex

A simplex is a triangle/tetrahedron or higher dimensional equivalent.

Extended Capabilities

Thread-Based Environment
Run code in the background using MATLAB® backgroundPool or accelerate code with Parallel Computing Toolbox™ ThreadPool.

Version History

Introduced in R2009a