<!--
{
  "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",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation13ShapeResourceC"
  },
  "title" : "ShapeResource"
}
-->

# ShapeResource

A representation of a shape.

```
@MainActor @preconcurrency class ShapeResource
```

## Topics

### Transforming a shape

[`offsetBy(rotation:)`](/documentation/RealityKit/ShapeResource/offsetBy(rotation:))

Creates a new shape resource by applying a rotation.

[`offsetBy(translation:)`](/documentation/RealityKit/ShapeResource/offsetBy(translation:))

Creates a new shape resource by applying a translation.

[`offsetBy(rotation:translation:)`](/documentation/RealityKit/ShapeResource/offsetBy(rotation:translation:))

Creates a new shape resource by applying a rotation and a translation.

### Generating boxes

[`generateBox(size:)`](/documentation/RealityKit/ShapeResource/generateBox(size:))

Creates a box shape with the specified extent.

[`generateBox(width:height:depth:)`](/documentation/RealityKit/ShapeResource/generateBox(width:height:depth:))

Creates a box shape with the specified dimensions.

### Generating spheres

[`generateSphere(radius:)`](/documentation/RealityKit/ShapeResource/generateSphere(radius:))

Creates a sphere shape with the specified radius.

### Generating capsules

[`generateCapsule(height:radius:)`](/documentation/RealityKit/ShapeResource/generateCapsule(height:radius:))

Creates a capsule shape with the specified height and radius.

### Generating convex shapes

[`generateConvex(from:)`](/documentation/RealityKit/ShapeResource/generateConvex(from:)-6q0wj)

Creates a convex shape from the given points.

[`generateConvex(from:)`](/documentation/RealityKit/ShapeResource/generateConvex(from:)-53jm9)

Creates a convex shape from the given mesh.

### Comparing shapes

---

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)