Instance Method

mesh(using:)

Generates a closed polygon mesh around the volume of space the voxel array describes.

Declaration

func mesh(using allocator: MDLMeshBufferAllocator?) -> MDLMesh?

Parameters

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

Use this method to create a polygon mesh for use in rendering the object described by the voxel array.

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 generated and being loaded into GPU memory for rendering.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software