# 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.

# freeBoundary

Query free boundary facets

## Syntax

```FBtri = freeBoundary(TR) [FBtri,FBpoints] = freeBoundary(TR) ```

## Description

`FBtri = freeBoundary(TR)` returns the free boundary facets of `TR.ConnectivityList`. A facet in `TR` is on the free boundary if it is referenced by only one triangle or tetrahedron.

`[FBtri,FBpoints] = freeBoundary(TR)` also returns a matrix containing the vertices of the free boundary facets.

## Input Arguments

 `TR` Triangulation representation, see `triangulation` or `delaunayTriangulation`.

## Output Arguments

 `FBtri` Triangulation connectivity list, returned as a matrix that contains the following information: Each row in `FBtri` represents a facet on the free boundary.Each element is a Vertex ID. The vertex IDs in `FBtri` reference a specific matrix, depending on the syntax you choose: If you call `freeBoundary` with one output argument, then the elements of `FBtri` are row numbers of `TR.Points`.If you call `freeBoundary` with two output arguments, then the elements of `FBtri` are row numbers of `FBpoints`. `FBpoints` Free boundary points, returned as a matrix containing the coordinates of the vertices of the free boundary facets. Each row of `FBpoints` contains coordinates of a vertex.

## Examples

expand all

Use `freeBoundary` to extract the facets of a 3-D triangulation that cover the surface of an object.

```load tetmesh; TR = triangulation(tet,X);```

Compute the boundary triangulation.

`[FBtri,FBpoints] = freeBoundary(TR);`

Plot the boundary triangulation.

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

Use `freeBoundary` when you want to highlight the outer edges of a 2-D Delaunay triangulation.

Create a triangulation from a random set of points.

```x = gallery('uniformdata',[20,1],0); y = gallery('uniformdata',[20,1],1); DT = delaunayTriangulation(x,y);```

Find the free boundary edges.

`fe = freeBoundary(DT)';`

Plot the mesh and highlight the free boundary edges in red.

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

expand all