---
title: "generatePlane(width:depth:cornerRadius:)"
framework: realitykit
role: symbol
role_heading: Type Method
path: "realitykit/meshresource/generateplane(width:depth:cornerradius:)"
---

# generatePlane(width:depth:cornerRadius:)

Creates a new rectangle mesh with the specified dimensions in the entity’s xz-plane.

## Declaration

```swift
@MainActor @preconcurrency static func generatePlane(width: Float, depth: Float, cornerRadius: Float = 0) -> MeshResource
```

## Parameters

- `width`: The width, in meters, of the rectangle along the x-axis.
- `depth`: The depth, in meters, of the rectangle along the z-axis.
- `cornerRadius`: A corner radius in the form of a circular arc, with curvature that transitions abruptly from 0 to 1/r at the boundary between the edge and the corner.

## Return Value

Return Value The rectangle mesh.

## Discussion

Discussion The rectangle is centered at the entity’s origin and aligned with its x and z axes. The surface normal points along the y-axis. The depth along the y-axis is 0. note: The xz-plane is a plane that aligns with the x and z axes.

## See Also

### Creating a plane

- [generatePlane(width:height:cornerRadius:)](realitykit/meshresource/generateplane(width:height:cornerradius:).md)
