---
title: MDLVoxelArray
framework: modelio
role: symbol
role_heading: Class
path: modelio/mdlvoxelarray
---

# MDLVoxelArray

A model of a 3D object’s solid volume as a collection of voxels, or cubic units.

## Declaration

```swift
class MDLVoxelArray
```

## Overview

Overview Unlike a mesh, which models only surface topology, a voxel array models the solid volume of a 3D object. Voxels are useful for modeling volumetric phenomena (such as clouds and fire), performing solid geometry operations (such as intersection and union), and preparing a 3D design for real-world physical production.

## Topics

### Creating a Voxel Array

- [init(asset:divisions:interiorShells:exteriorShells:patchRadius:)](modelio/mdlvoxelarray/init(asset:divisions:interiorshells:exteriorshells:patchradius:).md)
- [init(asset:divisions:interiorNBWidth:exteriorNBWidth:patchRadius:)](modelio/mdlvoxelarray/init(asset:divisions:interiornbwidth:exteriornbwidth:patchradius:).md)
- [init(data:boundingBox:voxelExtent:)](modelio/mdlvoxelarray/init(data:boundingbox:voxelextent:).md)

### Examining Voxels

- [count](modelio/mdlvoxelarray/count.md)
- [voxelIndexExtent](modelio/mdlvoxelarray/voxelindexextent.md)
- [voxelExists(atIndex:allowAnyX:allowAnyY:allowAnyZ:allowAnyShell:)](modelio/mdlvoxelarray/voxelexists(atindex:allowanyx:allowanyy:allowanyz:allowanyshell:).md)
- [voxels(within:)](modelio/mdlvoxelarray/voxels(within:).md)
- [voxelIndices()](modelio/mdlvoxelarray/voxelindices().md)

### Modifying Voxels

- [setVoxelAtIndex(_:)](modelio/mdlvoxelarray/setvoxelatindex(_:).md)
- [setVoxelsFor(_:divisions:interiorNBWidth:exteriorNBWidth:patchRadius:)](modelio/mdlvoxelarray/setvoxelsfor(_:divisions:interiornbwidth:exteriornbwidth:patchradius:).md)
- [setVoxelsFor(_:divisions:interiorShells:exteriorShells:patchRadius:)](modelio/mdlvoxelarray/setvoxelsfor(_:divisions:interiorshells:exteriorshells:patchradius:).md)

### Performing Constructive Solid Geometry Operations

- [union(with:)](modelio/mdlvoxelarray/union(with:).md)
- [intersect(with:)](modelio/mdlvoxelarray/intersect(with:).md)
- [difference(with:)](modelio/mdlvoxelarray/difference(with:).md)

### Relating Voxels to Scene Space

- [boundingBox](modelio/mdlvoxelarray/boundingbox.md)
- [index(ofSpatialLocation:)](modelio/mdlvoxelarray/index(ofspatiallocation:).md)
- [spatialLocation(ofIndex:)](modelio/mdlvoxelarray/spatiallocation(ofindex:).md)
- [voxelBoundingBox(atIndex:)](modelio/mdlvoxelarray/voxelboundingbox(atindex:).md)

### Creating a Mesh from Voxels

- [mesh(using:)](modelio/mdlvoxelarray/mesh(using:).md)

### Constants

- [MDLVoxelIndex](modelio/mdlvoxelindex.md)
- [MDLVoxelIndexExtent](modelio/mdlvoxelindexextent.md)

### Initializers

- [init(asset:divisions:patchRadius:)](modelio/mdlvoxelarray/init(asset:divisions:patchradius:).md)

### Instance Properties

- [isValidSignedShellField](modelio/mdlvoxelarray/isvalidsignedshellfield.md)
- [shellFieldExteriorThickness](modelio/mdlvoxelarray/shellfieldexteriorthickness.md)
- [shellFieldInteriorThickness](modelio/mdlvoxelarray/shellfieldinteriorthickness.md)

### Instance Methods

- [coarseMesh()](modelio/mdlvoxelarray/coarsemesh().md)
- [coarseMesh(using:)](modelio/mdlvoxelarray/coarsemesh(using:).md)
- [convertToSignedShellField()](modelio/mdlvoxelarray/converttosignedshellfield().md)
- [setVoxelsFor(_:divisions:patchRadius:)](modelio/mdlvoxelarray/setvoxelsfor(_:divisions:patchradius:).md)

## Relationships

### Inherits From

- [MDLObject](modelio/mdlobject.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [MDLNamed](modelio/mdlnamed.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
