---
title: voxelIndices()
framework: modelio
role: symbol
role_heading: Instance Method
path: modelio/mdlvoxelarray/voxelindices()
---

# voxelIndices()

Returns a data object containing all voxels within the voxel array.

## Declaration

```swift
func voxelIndices() -> Data?
```

## Return Value

Return Value A data object containing MDLVoxelIndex values.

## Discussion

Discussion The returned NSData object contains an array of MDLVoxelIndex values describing the locations of voxels within the voxel array as well as their volumetric relationship to the object modeled by the voxel array. Calling this method is equivalent to calling the voxels(within:) method with the value of the voxelIndexExtent property.

## See Also

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