Skip to Main Content Skip to Search
Product Documentation

neighbors - Class: TriRep

Simplex neighbor information

Syntax

SN = neighbors(TR, SI)

Description

SN = neighbors(TR, SI) returns the simplex neighbor information for the specified simplices SI.

Input Arguments

TRTriangulation representation.
SISI is a column vector of simplex indices that index into the triangulation matrix TR.Triangulation. If SI is not specified the neighbor information for the entire triangulation is returned, where the neighbors associated with simplex i are defined by the i'th row of SN.

Output Arguments

SN

SN is an m-by-n matrix, where m = length(SI) , the number of specified simplices, and n is the number of neighbors per simplex. Each row SN(i,:) represents the neighbors of the simplex SI(i).

By convention, the simplex opposite vertex(j) of simplex SI(i) is SN(i,j). If a simplex has one or more boundary facets, the nonexistent neighbors are represented by NaN.

Definitions

A simplex is a triangle/tetrahedron or higher-dimensional equivalent. A facet is an edge of a triangle or a face of a tetrahedron.

Examples

Example 1

Load a 3-D triangulation and use TriRep to compute the neighbors of all tetrahedra.

load tetmesh
trep = TriRep(tet, X)
nbrs = neighbors(trep) 

Example 2

Query a 2-D triangulation created using DelaunayTri.

x = rand(10,1)
y = rand(10,1)
dt = DelaunayTri(x,y)

Find the neighbors of the first triangle:

n1 = neighbors(dt, 1)

See Also

DelaunayTri

  


Free MATLAB Interactive Kit

Explore how to use MATLAB to make advancements in engineering and science.


Download free kit

Trials Available

Try the latest version of MATLAB and other MathWorks products.


Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS