Regions

Distance to Region Edge

Approximate nonnegative 3D distance in blocks to a region boundary, saturated at maxDistance.

density.distance_to_region_edge

Distance to Region EdgeRegion keysSample step4Max distance32

Inputs and outputs

NameTypeDefaultWhat it changes
Inputs
Sample stepInteger4 · 1–32
Max distanceInteger32 · 1–128
Settings
Region keysText""
Output
OutputDensity

Good to know

Current leaf or target union

Leave regionKeys empty to detect every selected Region Output boundary, even between regions sharing one logical biome. Set comma-separated query keys to measure only the boundary of their union, ignoring internal transitions. Returns distance on both sides; combine with Region Membership for an inside-only fade.

Quality and cost

sampleStep is 1..32 blocks (default 4); maxDistance is 1..128 (default 32), at most 32 steps per ray. Uses 26 directions on a global XYZ lattice and interpolates cached estimates. Thin features or edges between rays can be missed; distance may remain positive at a boundary. This is not an exact SDF or containment guarantee. Smaller steps and larger radii cost more; matching queries share a bounded cache.

Stage contract

Use downstream of region selection, never in Choose Region inputs. Query keys follow Region Membership rules. This is independent of biome tint blending and does not implicitly clip placed structures.

More in Regions