# Documentation

### This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English verison of the page.

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

# freeBoundary

Class: TriRep

(Not recommended) Facets referenced by only one simplex

### Note

`freeBoundary(TriRep)` is not recommended. Use `freeBoundary(triangulation)` instead.

`TriRep` is not recommended. Use `triangulation` instead.

## Syntax

```FF = freeBoundary(TR) [FF XF] = freeBoundary(TR) ```

## Description

`FF = freeBoundary(TR)` returns a matrix `FF` that represents the free boundary facets of the triangulation. A facet is on the free boundary if it is referenced by only one simplex (triangle/tetrahedron, etc). `FF` is of size `m`-by-`n`, where m is the number of boundary facets and n is the number of vertices per facet. The vertices of the facets index into the array of points representing the vertex coordinates `TR.X`. The array `FF` could be empty as in the case of a triangular mesh representing the surface of a sphere.

`[FF XF] = freeBoundary(TR)` returns a matrix of free boundary facets

## Input Arguments

 `TR` Triangulation representation.

## Output Arguments

 `FF` `FF` that has vertices defined in terms of a compact array of coordinates `XF`. `XF` `XF` is of size `m`-by-`ndim` where `m` is the number of free facets, and `ndim` is the dimension of the space where the triangulation resides

## Examples

### Example 1

Use `TriRep` to compute the boundary triangulation of an imported triangulation.

Load a 3-D triangulation:

```load tetmesh; trep = TriRep(tet, X); ```

Compute the boundary triangulation:

` [tri xf] = freeBoundary(trep);`

Plot the boundary triangulation:

```trisurf(tri, xf(:,1),xf(:,2),xf(:,3), ... 'FaceColor','cyan', 'FaceAlpha', 0.8);```

### Example 2

Perform a direct query of a 2-D triangulation created with `DelaunayTri`.

Plot the mesh:

``` x = rand(20,1); y = rand(20,1); dt = DelaunayTri(x,y); fe = freeBoundary(dt)'; triplot(dt); hold on; ```

Display the free boundary edges in red:

```plot(x(fe), y(fe), '-r', 'LineWidth',2) ; hold off; ```

In this instance the free edges correspond to the convex hull of `(x, y)`.

expand all