Show / Hide Table of Contents

Relax Modifier

Quick facts
ClassRelaxModifier
CellTypeUnchanged
CellDirUnchanged
CellRotationUnchanged
BoundSquareBound
PropertiesUnchanged
RequirementsBase 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.

In This Article
Back to top Generated by DocFX