---
title: "generateConvex(from:)"
framework: realitykit
role: symbol
role_heading: Type Method
path: "realitykit/shaperesource/generateconvex(from:)"
---

# generateConvex(from:)

Creates a convex shape from the given mesh.

## Declaration

```swift
@MainActor @preconcurrency static func generateConvex(from mesh: MeshResource) -> ShapeResource
```

## Parameters

- `mesh`: A mesh with the shape of the convex polyhedron. Use meshes with a small number of vertices to avoid hurting performance.

## Return Value

Return Value The new shape.
