---
title: "generateBox(size:)"
framework: realitykit
role: symbol
role_heading: Type Method
path: "realitykit/shaperesource/generatebox(size:)"
---

# generateBox(size:)

Creates a box shape with the specified extent.

## Declaration

```swift
@MainActor @preconcurrency static func generateBox(size: SIMD3<Float>) -> ShapeResource
```

## Parameters

- `size`: The box extent in meters along the local axes.

## Return Value

Return Value The new box centered at the local origin and aligned with the local axes.

## Discussion

Discussion note: Collision shape extents that fall below 2mm are forced to be 2mm in size - this includes, entities with negative scale values.

## See Also

### Generating boxes

- [generateBox(width:height:depth:)](realitykit/shaperesource/generatebox(width:height:depth:).md)
