dharmatiles turns a short text file into a 3D-printable terrain tile for tabletop games: ground, grass, rocks, cliffs, water, walls and trees, on a 35 mm DungeonBlocks or 25.4 mm OpenLOCK base, printable on a home FDM printer without supports. The file is a .dtile document, and this site is the reference for its language.
dharmatiles version="1.0.0"
// my-pond.dtile
tile size="1x1" seed=97 {
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 shoreBand { within "7dmm" of=shore }
stack {
base
dirt {
pin top="[$waterBedHeight .. $groundHeight + 1dmm]" at=shoreBand // anywhere from the bed to the land
pin top="$waterBedHeight" at=pool // later, so it wins in the pool
}
water
scatter at=pool count=2 { rock size="6dmm .. 10dmm" }
grass at=bank
}
}

lib:tiles/water/1x1-water+grass.dtile.A line divides the tile, regions name its sides, and the stack says what goes where: dirt pinned down to the water's bed in the pool, grass on the bank, two rocks and water in the pool. Every length carries its unit, and dmm is 1/35 of a square, so the OpenLOCK build scales sizes for you; points are counted from the north-west corner.
| To | Run |
|---|---|
| Build it (DungeonBlocks) | dharmatiles build my-pond.dtile → out/db/my-pond-db.stl |
| Build it for OpenLOCK, with preview images | dharmatiles build my-pond.dtile --system ol --png |
| Watch it in the browser as you edit | dharmatiles preview my-pond.dtile --open |
| Browse your tiles and the library | dharmatiles on its own, or dharmatiles preview --open (your tiles live in ~/dharmatiles, or set DT_HOME; name folders to browse those instead) |
| Check it without building | dharmatiles check my-pond.dtile (add --system ol or --printer fine to check for that target, as build takes them; sizes depend on the system, so a tile can pass for one and fail for the other) |
| Mend what the program can mend | dharmatiles fix my-pond.dtile shows each fix (the point moved onto its seam, the word written right) and by how many millimetres on the target; --write makes them, and a folder fixes every tile in it (see Fixing a tile) |
| Build every library tile | dharmatiles build --all (add --system ol for OpenLOCK). A build that is already kept is read, not made: the second run takes seconds; --no-cache builds from nothing |
| See, list or empty the cache of builds | dharmatiles cache, dharmatiles cache list, dharmatiles cache clear; dharmatiles cache previews builds the library's super-low previews into it (see the cache of builds) |
| Lay a print list out on a printer's plates | dharmatiles plates my-list.dmap: one Bambu Studio project with every plate, or one STL per plate (see Plates and Printers); --check plans without building |
| Keep track of what you have printed | dharmatiles inventory, dharmatiles inventory have <tile>: a print list then prints only what you lack (see Inventory); plates --all prints everything |
| List the elements and their controls | dharmatiles elements, dharmatiles elements cliff |
Every tile passes a printability gate before it is written: watertight, nothing lost, and no overhang past 55° (55–65° allowed in small patches, past 65° fails). Print it base down, with no supports; see printing.
There are no prebuilt downloads yet. You need Rust and git:
git clone https://github.com/shawn-vincent/dharmatiles.git
cd dharmatiles
cargo build --release # a few minutes, once
./target/release/dharmatiles elements # it works: lists the elements
Run it from inside the checkout and it finds the library (lib:tiles/…, use "parts/grass") by itself. To run it from anywhere, put target/release on your PATH and set DT_LIBRARY to the checkout's library folder. Output goes to an out/ folder where you run it (or --out): out/db/ for DungeonBlocks, out/ol/ for OpenLOCK.
cp library/tiles/water/1x1-water+grass.dtile my-pond.dtile. The elements pages list which library tiles use each element.dharmatiles preview my-pond.dtile --open shows the tile in your browser, painted, with overhangs in red. It rebuilds every time you save, and shows a mistake at its line.seed= for another version of the same tile.dharmatiles build my-pond.dtile for DungeonBlocks, --system ol for OpenLOCK, --printer fine for another printer profile, --3mf for a 3MF painted by material, ready for a multi-colour printer (a Bambu Studio project with its filament slots when you give it a template).
dirtBare earth with clods, grit and half-sunk pebbles over gentle rises.
grass · flowers · reedsSeparate sculpted blades in tufts, parting round patches of bare earth.
rock · stone · boulder · pebbleChiselled stones, alone or scattered, bedded in the ground.
cliffA storey-high band or mass of broken rock, with scree at its foot.
waterSculpted water: swells off the shore and chop round rocks.
wall · flagstonesCut stone, fieldstone and brick walls on a tile edge, and stone and plank floors.
treeA barked, forking trunk and clumps of foliage covered in separate leaves.
All elementstile, let, line, region, stack, use, define, scatter, the bases and the library files.
What the program does today, and what is not built yet. Everything outstanding is on the roadmap, and the editor the preview is becoming is in its design.
| Works | Not built yet |
|---|---|
| Every element on the elements pages builds: dirt, grass, reeds, flowers, water, rocks and scatter, trees, walls, flagstone and plank floors, and cliffs. | A line's width=, and building at= a drawn line (walls, paths, surfaces). check names the lines; build refuses them. |
| DungeonBlocks and OpenLOCK bases from one document; STL, a 3MF painted by material (a Bambu Studio project with a template), and PNG views. | Doors, windows and hatches in walls. |
The preview, watch, and the whole library (build --all, once for each base). | Prebuilt downloads, and builds for Linux and Windows. |