# SimplexBoundary

Contributed by: Richard Hennigan (Wolfram Research)

Find the topological boundary of a simplex or simplicial complex

 ResourceFunction["SimplexBoundary"][simplex] finds the topological boundary of simplex. ResourceFunction["SimplexBoundary"][{simplex1,simplex2,…}] finds the topological boundary of the simplicial complex containing simplex1,simplex2,…. ResourceFunction["SimplexBoundary"][mesh] finds the topological boundary of the MeshRegion mesh. ResourceFunction["SimplexBoundary"][complex,k] finds the topological boundary of the k-skeleton of complex.

## Details and Options

A simplex can be considered any of the following:
 Point [ v ] point Line [ { v 1 , v 2 } ] line segment Triangle[{v1,v2,v3}] or Polygon[{v1,v2,v3}] filled triangle Tetrahedron [ { v 1 , v 2 , v 3 , v 4 } ] filled tetrahedron Simplex [ { v 1 , v 2 , … , v n } ] an n-1 dimensional simplex
A simplicial complex is either a list of simplices, or a MeshRegion, where all cells are valid simplices.
The boundary preserves orientations so that it can be used for simplicial homology computations.

## Examples

### Basic Examples

Retrieve the ResourceFunction:

 In[1]:=
 Out[1]=

Get the boundary of a Simplex:

 In[2]:=
 Out[2]=

Get the boundary of a simplicial complex, represented as a list of simplices:

 In[3]:=
 Out[3]=

Get the boundary of a MeshRegion:

 In[4]:=
 Out[4]=
 In[5]:=
 Out[5]=

### Scope

By default, the boundary will be computed from simplices that match the dimension of the simplicial complex:

 In[6]:=
 Out[6]=

A different dimension k can be specified, which will find the boundary of the k-skeleton of the complex:

 In[7]:=
 Out[7]=

### Generalizations & Extensions

Some other primitives can represent a simplex as well:

 In[8]:=
 Out[8]=
 In[9]:=
 Out[9]=

### Applications

Find holes in a 3D model:

 In[10]:=
 Out[10]=
 In[11]:=
 Out[11]=

Highlight the boundary edges:

 In[12]:=
 Out[12]=

### Properties and Relations

Orientation is preserved:

 In[13]:=
 Out[13]=
 In[14]:=
 Out[14]=

The boundary of a boundary is always empty:

 In[15]:=
 Out[15]=
 In[16]:=
 Out[16]=
 In[17]:=
 Out[17]=

A graph can be considered a 1-dimensional simplicial complex:

 In[18]:=
 Out[18]=
 In[19]:=
 Out[19]=

The boundary can give you information about degree of vertices:

 In[20]:=
 Out[20]=

### Possible Issues

Not all graphics primitives are valid simplices:

 In[21]:=
 Out[21]=
 In[22]:=
 Out[22]=

They can often be converted to simplicial complexes using DiscretizeGraphics that are reasonable approximations:

 In[23]:=
 Out[23]=
 In[24]:=
 Out[24]=

Valid n-dimensional simplices must have n+1 vertices:

 In[25]:=
 Out[25]=
 In[26]:=
 Out[26]=

MeshRegions are not necessarily composed of simplices:

 In[27]:=
 Out[27]=
 In[28]:=
 Out[28]=

TriangulateMesh often can be used to create a valid simplicial complex:

 In[29]:=
 Out[29]=

Vertices must be unique:

 In[30]:=
 Out[30]=

If orientations are not consistent within a simplicial complex, the boundary will not have consistent orientations either:

 In[31]:=
 Out[31]=
 In[32]:=
 Out[32]=

### Interactive Examples

One can visualize 4D shapes by rotating and projecting the boundary into 3D. Here's an example using a hexadecachoron:

 In[33]:=
 Out[33]=
 In[34]:=
 Out[34]=

### Neat Examples

The boundary of an annulus is two circles while the boundary of a Moebius Strip is a single circle:

 In[35]:=
 Out[35]=

Get text outlines:

 In[36]:=
 Out[36]=