---
title: "init(data:boundingBox:voxelExtent:)"
framework: modelio
role: symbol
role_heading: Initializer
path: "modelio/mdlvoxelarray/init(data:boundingbox:voxelextent:)"
---

# init(data:boundingBox:voxelExtent:)

Initializes a voxel array with the specified voxel data.

## Declaration

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

## Parameters

- `voxelData`: A data object containing an array of doc://com.apple.modelio/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

Return Value A new voxel array.

## Discussion

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.

## See Also

### 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)
