TriangleLink`
TriangleLink`
TriangleGetNeighbors
TriangleGetNeighbors[expr]
gets the neighbors in a Triangle expression.
Details and Options
- To use TriangleGetNeigbors, you first need to load it using Needs["TriangleLink`"].
- TriangleGetNeigbors returns a list of a list of integers that specify which tetrahedra are next to each other. An entry of
indicates that the respective triangle is on the boundary.
- TriangleGetNeigbors needs the "n" switch to be set during the call to TriangleTriangulate.
Examples
Basic Examples (1)Summary of the most common use cases
In[1]:=1

✖
https://wolfram.com/xid/04ihdhkhhvodvvv0d4m17q8fbo-cbf55e
This creates an instance of a Triangle expression:
In[2]:=2

✖
https://wolfram.com/xid/04ihdhkhhvodvvv0d4m17q8fbo-c6p5a4
Out[2]=2

This sets up points and segments to use:
In[3]:=3

✖
https://wolfram.com/xid/04ihdhkhhvodvvv0d4m17q8fbo-0kep9
This sets the points and facets in the Triangle instance:
In[4]:=4

✖
https://wolfram.com/xid/04ihdhkhhvodvvv0d4m17q8fbo-hk1sfz
This carries out the triangulation, returning a new Triangle instance. The switch "n" requests Triangle to compute the neighbors:
In[5]:=5

✖
https://wolfram.com/xid/04ihdhkhhvodvvv0d4m17q8fbo-bvezjn
Out[5]=5

This extracts the points and elements from the triangulation:
In[6]:=6

✖
https://wolfram.com/xid/04ihdhkhhvodvvv0d4m17q8fbo-fw39wj
This is a list of the neighboring elements, with indicating a boundary:
In[7]:=7

✖
https://wolfram.com/xid/04ihdhkhhvodvvv0d4m17q8fbo-mpjgal
Out[7]=7

You can visualize the triangles:
In[8]:=8

✖
https://wolfram.com/xid/04ihdhkhhvodvvv0d4m17q8fbo-4y4o4e
Out[8]=8
