# triangulation

Create `triangulation` object from `fegeometry`

Since R2023b

## Syntax

``TR = triangulation(gm)``

## Description

example

````TR = triangulation(gm)` creates a `triangulation` object from the specified `fegeometry` object. The geometry must have one cell in 3-D or one face in 2-D.```

## Examples

collapse all

Create a 2-D `triangulation` object from the unit square geometry.

First, create an `fegeometry` object representing the unit square.

`gm = fegeometry(@squareg)`
```gm = fegeometry with properties: NumFaces: 1 NumEdges: 4 NumVertices: 4 NumCells: 0 Vertices: [4x2 double] Mesh: [] ```

Create a `triangulation` object from the `fegeometry` object.

`TR = triangulation(gm)`
```TR = triangulation with properties: Points: [48x2 double] ConnectivityList: [46x3 double] ```

Create a 3-D `triangulation` object from a cylinder.

First, create an `fegeometry` object representing a cylinder.

`gm = fegeometry(multicylinder(5,2))`
```gm = fegeometry with properties: NumFaces: 3 NumEdges: 2 NumVertices: 2 NumCells: 1 Vertices: [2x3 double] Mesh: [] ```

Create a `triangulation` object from the `fegeometry` object.

`TR = triangulation(gm)`
```TR = triangulation with properties: Points: [98x3 double] ConnectivityList: [192x3 double] ```

## Input Arguments

collapse all

Single-domain geometry, specified as an `fegeometry` object. If you specify a 2-D geometry, it must have one face. If you specify a 3-D geometry, it must have one cell.

## Output Arguments

collapse all

Triangulation, returned as a `triangulation` object. For details, see `triangulation`.

## Version History

Introduced in R2023b