# sm.voxelTerrainCell.setDensityConvexHull

Sets density in convex hull shape to the cell's voxel grid.

**Kind:** Function

**Environments:** Terrain

## Terrain

``` { .lua .api-signature }
sm.voxelTerrainCell.setDensityConvexHull(
    vertices,
    margin,
    density,
    voxelFilter?,
    noiseFrequency?,
    noiseIntensity?
)
```

[Open the full Terrain reference](../Terrain-Script-Environment/Static-Functions/sm.voxelTerrainCell.md#setdensityconvexhull)

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `vertices` | table | Table of vertices \{[Vec3](../Terrain-Script-Environment/Userdata/Vec3.md), ...\} that make up the convex hull. |
| `margin` | number | Hull margin added outside the hull. |
| `density` | number | New normalized density. |
| `voxelFilter` *(optional)* | integer | The voxel material filter to overwrite. (Defaults to [sm.voxelTerrainCell.voxelFilter.all](../Terrain-Script-Environment/Static-Functions/sm.voxelTerrainCell.md#voxelfilter)) |
| `noiseFrequency` *(optional)* | number | Noise frequency of applied simplex noise. (Defaults to 1) |
| `noiseIntensity` *(optional)* | number | Noise intensity of applied simplex noise. (Defaults to 0) |
