---
title: "generateBox(size:majorCornerRadius:minorCornerRadius:)"
framework: realitykit
role: symbol
role_heading: Type Method
path: "realitykit/meshresource/generatebox(size:majorcornerradius:minorcornerradius:)"
---

# generateBox(size:majorCornerRadius:minorCornerRadius:)

Creates a box mesh from a vector of three scalar values that represent width, height, and depth, respectively, and radii for the corners.

## Declaration

```swift
@MainActor @preconcurrency static func generateBox(size: SIMD3<Float>, majorCornerRadius: Float = 0.2, minorCornerRadius: Float = 0.05) -> MeshResource
```

## Parameters

- `size`: The length of the box’s width, height, and depth, in meters, along the x-, y-, and z-axis, respectively.
- `majorCornerRadius`: The radius of each corner’s circular arc, in meters, orthogonal to the z-axis.
- `minorCornerRadius`: The radius of each corner’s circular arc, in meters, orthogonal to the x-axis.

## Discussion

Discussion The method centers the box at the entity’s origin and aligns the box’s faces with the coordinate system’s axes.

## See Also

### Creating a box

- [generateBox(size:cornerRadius:)](realitykit/meshresource/generatebox(size:cornerradius:)-8em0v.md)
- [generateBox(size:cornerRadius:)](realitykit/meshresource/generatebox(size:cornerradius:)-2ovma.md)
- [generateBox(width:height:depth:cornerRadius:splitFaces:)](realitykit/meshresource/generatebox(width:height:depth:cornerradius:splitfaces:).md)
