---
title: triangulate()
framework: gameplaykit
role: symbol
role_heading: Instance Method
path: gameplaykit/gkmeshgraph/triangulate()
---

# triangulate()

Creates or updates the graph with a network of nodes that describes the open space around its obstacles.

## Declaration

```swift
func triangulate()
```

## Discussion

Discussion The GKMeshGraph class adds, removes, and arranges nodes to describe the navigable areas around obstacles only when you call this method. Typically, you add or remove several obstacles, then call the triangulate() method to update the graph. You should also call this method after changing the triangulationMode property. After triangulating, the graph reflects the navigability of open space around its obstacles and can be used for any number of findPath(from:to:) calls. Changing the list of obstacles requires retriangulating the graph.

## See Also

### Managing the Mesh

- [triangulationMode](gameplaykit/gkmeshgraph/triangulationmode.md)
- [triangle(at:)](gameplaykit/gkmeshgraph/triangle(at:).md)
- [triangleCount](gameplaykit/gkmeshgraph/trianglecount.md)
