<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ModelIO",
  "identifier" : "/documentation/ModelIO/MDLVoxelArray/init(data:boundingBox:voxelExtent:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Model I/O"
    ],
    "preciseIdentifier" : "c:objc(cs)MDLVoxelArray(im)initWithData:boundingBox:voxelExtent:"
  },
  "title" : "init(data:boundingBox:voxelExtent:)"
}
-->

# init(data:boundingBox:voxelExtent:)

Initializes a voxel array with the specified voxel data.

```
init(data voxelData: Data, boundingBox: MDLAxisAlignedBoundingBox, voxelExtent: Float)
```

## Parameters

`voxelData`

A data object containing an array of [`MDLVoxelIndex`](/documentation/ModelIO/MDLVoxelIndex) values, each of which describes the locations of voxels within the specified volume as well as their volumetric relationship to the object modeled by the voxel array.

`boundingBox`

The extent of the voxel array’s volume in world coordinate space.

`voxelExtent`

The size of a single voxel in world coordinate space.

## Return Value

A new voxel array.

## Discussion

The `boundingBox` parameter relates the integer grid of the newly created voxel array to a continuous Cartesian space. The methods listed in Relating Voxels to Scene Space and Creating a Mesh from Voxels operate with respect to this bounding volume.

---

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)