<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/ShapeResource/generateConvex(from:)-53jm9",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation13ShapeResourceC14generateConvex4fromAcA04MeshD0C_tFZ"
  },
  "title" : "generateConvex(from:)"
}
-->

# generateConvex(from:)

Creates a convex shape from the given mesh.

```
@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

The new shape.

---

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)