<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GameplayKit",
  "identifier" : "/documentation/GameplayKit/GKMeshGraph/triangulate()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "GameplayKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GKMeshGraph(im)triangulate"
  },
  "title" : "triangulate()"
}
-->

# triangulate()

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

```
func triangulate()
```

## Discussion

The [`GKMeshGraph`](/documentation/GameplayKit/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()`](/documentation/GameplayKit/GKMeshGraph/triangulate()) method to update the graph. You should also call this method after changing the [`triangulationMode`](/documentation/GameplayKit/GKMeshGraph/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:)`](/documentation/GameplayKit/GKGraph/findPath(from:to:)) calls. Changing the list of obstacles requires retriangulating the graph.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)