Type Method


Generates a mesh in the shape of a rectangular plane.


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



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


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


The type of geometric primitive from which to construct the mesh; must be either kindTriangles or kindQuads.


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

Return Value

A new mesh object.


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

See Also

Creating Parametric Meshes

class func newIcosahedron(withRadius: Float, inwardNormals: Bool, allocator: MDLMeshBufferAllocator?) -> Self

Generates a mesh in the shape of a regular 20-sided polyhedron with triangular faces.