← Back to Docs
  • index.html
  • Clayground
  • Clayground.Canvas3D
  • StaticVoxelMap
  • Clayground 2025.2
  • StaticVoxelMap QML Type

    Optimized voxel map for large, static structures. More...

    Import Statement: import Clayground.Canvas3D
    Inherits:

    VoxelMap

    Properties

    Detailed Description

    StaticVoxelMap uses greedy meshing to combine adjacent voxels of the same color into larger quads, significantly reducing vertex count. This makes it ideal for large voxel structures that don't change frequently.

    The geometry is regenerated when voxels change, so use DynamicVoxelMap for frequently changing voxel data.

    Example usage:

    import Clayground.Canvas3D
    
    StaticVoxelMap {
        voxelCountX: 50
        voxelCountY: 20
        voxelCountZ: 50
        voxelSize: 1.0
        useToonShading: true
    
        Component.onCompleted: {
            fill({ sphere: { pos: Qt.vector3d(25, 10, 25), radius: 8,
                            colors: ["red", "orange"] } })
        }
    }

    See also DynamicVoxelMap and VoxelMapGeometry.

    Property Documentation

    voxelCountX : int

    Number of voxels along the X axis.


    voxelCountY : int

    Number of voxels along the Y axis (height).


    voxelCountZ : int

    Number of voxels along the Z axis.