The result

dharmatiles version="1.0.0"
// library/tests/ground/1x1-flat.dtile
tile size="1x1" {
about "Flat ground at the edge height (3.4 mm) on one square: the first tile built end to end."
stack {
base
dirt top="$dirtEdgeHeight" clods=none // flat, at the edge height (3.4 mm)
}
}
Say it plainly
You write a few heights; the library supplies the rest. Its defaults give the first dirt, and every water and floor, a top and a pin at the tile’s edges, so that any dirt tile butts any other with no step.
check works out the bands before any build, in tens of milliseconds, and tells you what cannot be solved.
The rules
Every body starts from the library’s defaults
Defaults. library/parts/edges.dtile also holds the tops and pins every body starts with, read before the tile's own lines:
dharmatiles version="1.0.0"
defaults {
dirt top="[$groundHeight .. $groundHeight + 1dmm]" { pin top="$dirtEdgeHeight" at=edges }
cliff top="$dirtEdgeHeight + 35dmm"
flagstones top="$floorHeight" { pin top="$floorEdgeHeight" at=edges }
planks top="$floorHeight" { pin top="$floorEdgeHeight" at=edges }
water top="[$waterSurfaceHeight - 1.9dmm .. $waterSurfaceHeight + 3dmm]" { pin top="$waterEdgeHeight" at=edges }
}
A tile's own top= replaces the default top, and its pins win over the default pin wherever they overlap. The dirt default applies to the first dirt only, so a second dirt laid over what is under it (dirt top="$bottom + [0.6dmm .. 1.2dmm]") is not pulled to the rim; the water, flagstones and planks defaults apply to every water and every floor. dharmatiles check --explain lists every default applied and where it came from, each override (override $waterBedHeight 0.4dmm → 0.8dmm), each pin's share of its place, and the region tree (regions).
check solves each band before anything is built
What check does with them. Besides reading the names and kinds, check solves each body's band on a lattice (no meshes, tens of milliseconds): the pins hold the band exactly where they are, dirt eases back toward the others no steeper than its slope (water settles over 9 mm; cliffs and floors do not ease: their stones and slabs step), and the result is the band the body fills. It refuses what cannot be solved and notes what looks wrong (the codes are in Errors). build solves the same bands again on the build's own lattice and fills them: a dirt draws hills in its band, a water draws its waves inside it, and a floor draws each slab's or board's height and tilt inside it. A cliff draws its stones inside its band, as a floor draws its slabs. A tree's top= is its height: $bottom is the ground at its foot, so top="$bottom + 40dmm" is 40 design millimetres tall wherever it stands and top="$groundHeight + 40dmm" reaches that height above zero. A tree's top is a cloud like a band's: each branch tip rolls smoothly inside it and the crown stays under its high.
Every tile meets its neighbours at the edge contract
Every tile also reads library/parts/edges.dtile, without a use line. Its defaults block (above) gives the first dirt, and every water and floor, a top and a pin at the tile's edges, so that neighbours butt with no step. So any dirt tile butts any other with no step, and any two water tiles meet in the same wave. A pin the tile writes later wins over a default where they overlap. See edges.
Errors this page explains
Next
Next: clouds, a top with odds.