<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ModelIO",
  "identifier" : "/documentation/ModelIO/MDLMesh/newPlane(withDimensions:segments:geometryType:allocator:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Model I/O",
      "ModelIO"
    ],
    "preciseIdentifier" : "c:objc(cs)MDLMesh(cm)newPlaneWithDimensions:segments:geometryType:allocator:"
  },
  "title" : "newPlane(withDimensions:segments:geometryType:allocator:)"
}
-->

# newPlane(withDimensions:segments:geometryType:allocator:)

Generates a mesh in the shape of a rectangular plane.

```
class func newPlane(withDimensions dimensions: vector_float2, segments: vector_uint2, geometryType: MDLGeometryType, allocator: (any MDLMeshBufferAllocator)?) -> Self
```

## Parameters

`dimensions`

A vector containing the width (x-component) and depth (y-component) of the plane to generate.

`segments`

The number of points to generate along each dimension. A larger number of points increases rendering fidelity but decreases rendering performance.

`geometryType`

The type of geometric primitive — triangles or quads — from which to construct the mesh.

`allocator`

An object responsible for allocating mesh vertex data. If `nil`, Model I/O  uses an internal allocator object.

## Return Value

A new mesh object.

## Discussion

This method generates vertex data for a plane centered at the origin of its local coordinate system and extending in the x- and z-axis directions. All surface normal vectors on the plane point in the positive y-axis direction.

The `allocator` parameter controls vertex data allocation for the mesh. For example, to use the MetalKit framework for loading vertex data into GPU buffers for rendering using Metal, pass a <doc://com.apple.documentation/documentation/MetalKit/MTKMeshBufferAllocator> object. By specifying an allocator, you can ensure that mesh data is copied a minimal number of times between being read from a file and being loaded into GPU memory for rendering.

---

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)