WOLFRAM

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

First, load the package:

This creates an instance of a Triangle expression:

Out[2]=2

This sets up points and segments to use:

This sets the points and facets in the Triangle instance:

This carries out the triangulation, returning a new Triangle instance. The switch "n" requests Triangle to compute the neighbors:

Out[5]=5

This extracts the points and elements from the triangulation:

This is a list of the neighboring elements, with indicating a boundary:

Out[7]=7

You can visualize the triangles:

Out[8]=8