<!--
{
  "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/MeshResource/generatePlane(width:depth:cornerRadius:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation12MeshResourceC13generatePlane5width5depth12cornerRadiusACSf_S2ftFZ"
  },
  "title" : "generatePlane(width:depth:cornerRadius:)"
}
-->

# generatePlane(width:depth:cornerRadius:)

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

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

The rectangle mesh.

## 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.

---

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)