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.


Basic Examples  (1)

First, load the package:

This creates an instance of a Triangle expression:

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:

This extracts the points and elements from the triangulation:

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

You can visualize the triangles: