---
title: "voxelExists(atIndex:allowAnyX:allowAnyY:allowAnyZ:allowAnyShell:)"
framework: modelio
role: symbol
role_heading: Instance Method
path: "modelio/mdlvoxelarray/voxelexists(atindex:allowanyx:allowanyy:allowanyz:allowanyshell:)"
---

# voxelExists(atIndex:allowAnyX:allowAnyY:allowAnyZ:allowAnyShell:)

Returns a Boolean value indicating whether the voxel array contains voxel data for the specified index.

## Declaration

```swift
func voxelExists(atIndex index: MDLVoxelIndex, allowAnyX: Bool, allowAnyY: Bool, allowAnyZ: Bool, allowAnyShell: Bool) -> Bool
```

## Parameters

- `index`: An index describing both the location of the voxel within the three-dimensional grid of the voxel array and its relationship to the volume of the object modeled by the voxel array.
- `allowAnyX`: If doc://com.apple.documentation/documentation/Swift/true, this method treats the x component of the index parameter as a wildcard. If doc://com.apple.documentation/documentation/Swift/false, this method requires an exact match for the x component.
- `allowAnyY`: If doc://com.apple.documentation/documentation/Swift/true, this method treats the y component of the index parameter as a wildcard. If doc://com.apple.documentation/documentation/Swift/false, this method requires an exact match for the y component.
- `allowAnyZ`: If doc://com.apple.documentation/documentation/Swift/true, this method treats the z component of the index parameter as a wildcard. If doc://com.apple.documentation/documentation/Swift/false, this method requires an exact match for the z component.
- `allowAnyShell`: If doc://com.apple.documentation/documentation/Swift/true, this method treats the w (shell level) component of the index parameter as a wildcard. If doc://com.apple.documentation/documentation/Swift/false, this method requires an exact match for the shell level component.

## Return Value

Return Value true if the voxel array contains at least one voxel index matching the specified parameters; otherwise false.

## Discussion

Discussion Use the allowAnyX, allowAnyY, allowAnyZ, and allowAnyShell parameters to perform wildcard searches. For example:

## See Also

### Examining Voxels

- [count](modelio/mdlvoxelarray/count.md)
- [voxelIndexExtent](modelio/mdlvoxelarray/voxelindexextent.md)
- [voxels(within:)](modelio/mdlvoxelarray/voxels(within:).md)
- [voxelIndices()](modelio/mdlvoxelarray/voxelindices().md)
