# Cesium3DTilesVoxelProvider

#### new Cesium.Cesium3DTilesVoxelProvider(options)
engine/Source/Scene/Cesium3DTilesVoxelProvider.js 71

A `VoxelProvider` that fetches voxel data from a 3D Tiles tileset.

Implements the `VoxelProvider` interface.

This object is normally not instantiated directly, use `Cesium3DTilesVoxelProvider.fromUrl`.

Name | Type | Description
--- | --- | ---
`options` | Cesium3DTilesVoxelProvider.ConstructorOptions | An object describing initialization options

##### Experimental

This feature is not final and is subject to change without Cesium's standard deprecation policy.

##### See:

- Cesium3DTilesVoxelProvider.fromUrl
- VoxelProvider
- VoxelPrimitive
- VoxelShapeType

### Extends

- VoxelProvider

### Members

#### readonly availableLevels : number|undefined
engine/Source/Scene/Cesium3DTilesVoxelProvider.js 350

The number of levels of detail containing available tiles in the tileset.

#### readonly className : string
engine/Source/Scene/Cesium3DTilesVoxelProvider.js 243

The metadata class for this tileset.

#### readonly componentTypes : Array.<MetadataComponentType>
engine/Source/Scene/Cesium3DTilesVoxelProvider.js 282

Gets the metadata component types.

#### readonly dimensions : Cartesian3
engine/Source/Scene/Cesium3DTilesVoxelProvider.js 202

Gets the number of voxels per dimension of a tile. This is the same for all tiles in the dataset.

#### readonly globalTransform : Matrix4
engine/Source/Scene/Cesium3DTilesVoxelProvider.js 134

A transform from local space to global space.

Default Value: `Matrix4.IDENTITY`

#### readonly maxBounds : Cartesian3|undefined
engine/Source/Scene/Cesium3DTilesVoxelProvider.js 189

Gets the maximum bounds. If undefined, the shape's default maximum bounds will be used instead.

#### readonly maximumTileCount : number|undefined
engine/Source/Scene/Cesium3DTilesVoxelProvider.js 337

The maximum number of tiles that exist for this provider. This value is used as a hint to the voxel renderer to allocate an appropriate amount of GPU memory. If this value is not known it can be undefined.

#### readonly maximumValues : Array.<Array.<number>>|undefined
engine/Source/Scene/Cesium3DTilesVoxelProvider.js 322

Gets the metadata maximum values.

#### readonly minBounds : Cartesian3|undefined
engine/Source/Scene/Cesium3DTilesVoxelProvider.js 175

Gets the minimum bounds. If undefined, the shape's default minimum bounds will be used instead.

#### readonly minimumValues : Array.<Array.<number>>|undefined
engine/Source/Scene/Cesium3DTilesVoxelProvider.js 309

Gets the metadata minimum values.

#### readonly names : Array.<string>
engine/Source/Scene/Cesium3DTilesVoxelProvider.js 256

Gets the metadata names.

#### readonly paddingAfter : Cartesian3
engine/Source/Scene/Cesium3DTilesVoxelProvider.js 230

Gets the number of padding voxels after the tile. This improves rendering quality when sampling the edge of a tile, but it increases memory usage.

Default Value: `Cartesian3.ZERO`

#### readonly paddingBefore : Cartesian3
engine/Source/Scene/Cesium3DTilesVoxelProvider.js 216

Gets the number of padding voxels before the tile. This improves rendering quality when sampling the edge of a tile, but it increases memory usage.

Default Value: `Cartesian3.ZERO`

#### readonly shape : VoxelShapeType
engine/Source/Scene/Cesium3DTilesVoxelProvider.js 161

Gets the `VoxelShapeType`

#### readonly shapeTransform : Matrix4
engine/Source/Scene/Cesium3DTilesVoxelProvider.js 148

A transform from shape space to local space.

Default Value: `Matrix4.IDENTITY`

#### readonly types : Array.<MetadataType>
engine/Source/Scene/Cesium3DTilesVoxelProvider.js 269

Gets the metadata types.

### Methods

#### static Cesium.Cesium3DTilesVoxelProvider.fromUrl(url) → Promise.<Cesium3DTilesVoxelProvider>
engine/Source/Scene/Cesium3DTilesVoxelProvider.js 385

Creates a `Cesium3DTilesVoxelProvider` that fetches voxel data from a 3D Tiles tileset.

Name | Type | Description
--- | --- | ---
`url` | Resource | string | The URL to a tileset JSON file

##### Returns:

The created provider

##### Throws:

- RuntimeException : Root must have content
- RuntimeException : Root tile content must have 3DTILES_content_voxels extension
- RuntimeException : Root tile must have implicit tiling
- RuntimeException : Tileset must have a metadata schema
- RuntimeException : Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider

##### Example:

    try {
      const voxelProvider = await Cesium3DTilesVoxelProvider.fromUrl(
        "http://localhost:8002/tilesets/voxel/tileset.json"
      );
      const voxelPrimitive = new VoxelPrimitive({
        provider: voxelProvider,
        customShader: customShader,
      });
      scene.primitives.add(voxelPrimitive);
    } catch (error) {
      console.error(`Error creating voxel primitive: ${error}`);
    }

##### See:

- `VoxelPrimitive`

#### requestData(options) → Promise.<VoxelContent>|undefined
engine/Source/Scene/Cesium3DTilesVoxelProvider.js 693

Requests the data for a given tile.

Name | Type | Description
--- | --- | ---
`options` | object | optional Object with the following properties:
Name | Type | Default | Description
--- | --- | --- | ---
`tileLevel` | number | `0` | optional The tile's level.
`tileX` | number | `0` | optional The tile's X coordinate.
`tileY` | number | `0` | optional The tile's Y coordinate.
`tileZ` | number | `0` | optional The tile's Z coordinate.

##### Returns:

A promise resolving to a VoxelContent containing the data for the tile, or undefined if the request could not be scheduled this frame.

### Type Definitions

#### Cesium.Cesium3DTilesVoxelProvider.ConstructorOptions
engine/Source/Scene/Cesium3DTilesVoxelProvider.js 27

Initialization options for the Cesium3DTilesVoxelProvider constructor

##### Properties:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`className` | string |  |  | The class in the tileset schema describing voxel metadata.
`names` | Array.<string> |  |  | The metadata names.
`types` | Array.<MetadataType> |  |  | The metadata types.
`componentTypes` | Array.<MetadataComponentType> |  |  | The metadata component types.
`shape` | VoxelShapeType |  |  | The `VoxelShapeType`.
`dimensions` | Cartesian3 |  |  | The number of voxels per dimension of a tile. This is the same for all tiles in the dataset.
`paddingBefore` | Cartesian3 | <optional> | Cartesian3.ZERO | The number of padding voxels before the tile. This improves rendering quality when sampling the edge of a tile, but it increases memory usage.
`paddingAfter` | Cartesian3 | <optional> | Cartesian3.ZERO | The number of padding voxels after the tile. This improves rendering quality when sampling the edge of a tile, but it increases memory usage.
`globalTransform` | Matrix4 | <optional> | Matrix4.IDENTITY | A transform from local space to global space.
`shapeTransform` | Matrix4 | <optional> | Matrix4.IDENTITY | A transform from shape space to local space.
`minBounds` | Cartesian3 | <optional> |  | The minimum bounds.
`maxBounds` | Cartesian3 | <optional> |  | The maximum bounds.
`minimumValues` | Array.<Array.<number>> | <optional> |  | The metadata minimum values.
`maximumValues` | Array.<Array.<number>> | <optional> |  | The metadata maximum values.
`maximumTileCount` | number | <optional> |  | The maximum number of tiles that exist for this provider. This value is used as a hint to the voxel renderer to allocate an appropriate amount of GPU memory. If this value is not known it can be undefined.

Need help? The fastest way to get answers is from the community and team on the Cesium Forum.