Writing it
line shore wobble="5dmm" { through "wsw" "e" }
region pool { boundedBy shore; fill "(0.5sq, 0.75sq)" }
region bank { boundedBy shore; fill "(0.5sq, 0.25sq)" }
region reach { within "5dmm" of=shore } // a strip beside the line
region dry { except pool } // everything but the pool
stack {
base
dirt { pin top="$waterBedHeight" at=pool } // a region is a place a pin holds
water // fills its area up to its top
grass at=bank // and where a coat grows, off the wet ground
}
Try it

dharmatiles version="1.0.0"
// Lengths carry a unit: `dmm` is a design millimetre at the 35 mm square (it prints smaller on
// OpenLOCK), `sq` is a square. The wobble is 6dmm, and the band round the line is 7dmm.
tile size="1x1" seed=4 {
line stream wobble="6dmm" { through "(0sq, 0.5sq)" "(1sq, 0.5sq)" }
region band { within "7dmm" of=stream }
stack {
base
dirt
grass at=band
}
}
within "7dmm" of=stream is everything within 7 design millimetres of the line, and the grass follows it.
dharmatiles version="1.0.0"
// A line with a wobble: the shore of a pond. The line goes through two points and may wander
// up to 5dmm off the straight path between them; the seed decides how.
tile size="1x1" seed=97 {
line shore wobble="5dmm" { through "(0sq, 2sq/3)" "(1sq, 0.5sq)" }
region pool { boundedBy shore; fill "(0.5sq, 0.85sq)" }
region bank { boundedBy shore; fill "(0.5sq, 0.2sq)" }
stack {
base
dirt
grass at=bank
}
}
boundedBy shore says which side of it each fill point is on.Reference
| Written | Takes | Default | What it does |
|---|---|---|---|
region NAME | a name | — | Its name, for at=. Required. |
boundedBy | line names | — | The lines that bound it. |
fill | a point | — | A point inside it, "(across, down)" with units or a point's name; a half may be a range, drawn once from the tile seed like a line's points (demo/line-drawn.dtile). Several fill points on different sides of a line join those areas into one region. |
within LENGTH of=PLACE | a length, a place | — | Everything within that distance of a point, a line or a region: a disc round a point, a strip beside a line, a ring round a region (the region itself included). A length in dmm or sq scales with the system. A range in it, within "[10dmm .. 20dmm]" of=northEdge, draws the depth along the place: masses 6 to 15 design millimetres long, each as deep as the range draws it (the same for the region and place whatever the seed), the middle of the range at both ends so runs butt. |
except | region names | — | Takes those regions out. A region that only excepts starts from the whole tile. |
Notes
The whole tile is the default area, so an undivided tile needs no region. The words add together: the fills, then each within, then except takes away. A region is flat, a footprint and nothing else; it is also a frame (every thing makes a region): $region, $tile and parent() name regions in a formula, and x($region, sq), d($region, %) and a($region, %) measure in one. how high a body is over it is the body's top and pin. Bodies, grass and scatter take a region with at=; a point or a line is refused (dt::type). A region whose fill points all lie on its lines is an error.
Seen from the language
The guide pages that use region: Regions.
