Filter Cells - Remove Small Regions
Remove all connected regions smaller than a specified size threshold.
What it does
Identifies connected components (4-way or 8-way) and filters out any region whose size is < Min Region Size.
Inputs
| Field | Description |
|---|---|
| Cells | Input open cells as Vector2Int positions. |
| Min Region Size | Regions smaller than this many cells are removed. |
| Use 8 Neighbors | If enabled, diagonal cells are considered connected (8-way). If disabled, uses 4-way. |
Outputs
| Field | Description |
|---|---|
| Filtered Cells | Cells with small regions removed. Supports input == output safely. |
How it works
Runs flood-fill to find components, then keeps only those with size ≥ Min Region Size.
Tips
- Great as a cleanup step after noisy generation.
- For large maps, a higher threshold quickly removes specks without changing main topology.