<!--
{
  "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/voxelIndices()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Model I/O"
    ],
    "preciseIdentifier" : "c:objc(cs)MDLVoxelArray(im)voxelIndices"
  },
  "title" : "voxelIndices()"
}
-->

# voxelIndices()

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

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

## Return Value

A data object containing [`MDLVoxelIndex`](/documentation/ModelIO/MDLVoxelIndex) values.

## Discussion

The returned <doc://com.apple.documentation/documentation/Foundation/NSData> object contains an array of [`MDLVoxelIndex`](/documentation/ModelIO/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:)`](/documentation/ModelIO/MDLVoxelArray/voxels(within:)) method with the value of the [`voxelIndexExtent`](/documentation/ModelIO/MDLVoxelArray/voxelIndexExtent) property.

---

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)