Relax Modifier
| Quick facts | |
|---|---|
| Class | RelaxModifier |
| CellType | Unchanged |
| CellDir | Unchanged |
| CellRotation | Unchanged |
| Bound | SquareBound |
| Properties | Unchanged |
| Requirements | Base grid must be planar. |
This modifier performs mesh relaxation on the input grid. This tends to make things rounder and more evenly sized.
RelaxModifier is designed to work with infinite grids, if you have a finite grid, you'll find it much more efficient to use MeshDataOperations.Relax:
var relaxedMesh = new MeshGrid(originalGrid.ToMeshData().Relax());
Internally, RelaxModifier takes inspiration from Townscaper. The input grid is subdivided into hexagon chunks. A relaxation is done separately for every hexagon plus its neighbors to get a bunch of relaxed patches. Finally the modifier smoothly blends between relaxed patches.
There's several configuration settings documented on the constructor.
➡
Cell co-ordinates
Uses the same co-ordinates as underlying.