Run it
dharmatiles # Places: your tiles, the folders you added and the library, in the browser
dharmatiles preview my-tile.dtile --open # one document
dharmatiles preview a.dtile b.dtile walls/ # several files and folders
dharmatiles preview lib:tiles/cliffs # one library group
dharmatiles preview my-tile.dtile --system ol # start on OpenLOCK (the title bar's chip changes it)
dharmatiles preview my-tile.dtile --printer fine # start on another printer profile
dharmatiles preview slicer-export.stl # any binary STL, through the same gate
The sidebar is two pages. The first is the folders: the levels above the tile (Places and folders). Choose a tile and the editor slides in from the right, the same slide as any level's (a folder is one level, the tile one deeper); ‹ at the left of the crumbs (Places › My tiles › dungeon › 2x2-meadow
) slides back to the folder the tile is in, and the tile's name at the top right of the list, or Esc, returns to the tile. With nothing named, the places are My tiles ($DT_HOME, else ~/dharmatiles), the folders you have added, the Library, and Tests, the tiles the program's own tests build (odd shapes and edge cases among them; open one to see what a test sees, or make it yours like a library tile). Folders are watched: a new tile appears in the list within a second, and a deleted one leaves it.
It serves http://127.0.0.1:7878/ (the first free port from 7878, or --port) on the loopback address only, and refuses a request whose Host is not 127.0.0.1, localhost or [::1]. Ctrl-C stops it.
What it shows
- The title bar: whether the document's source is saved (its name is the crumb's), undo and redo, the build target and Export.
- The status line, 26 px under the view: the verdict, worst first (building 44% · grass (rebuilding while an earlier build the cache kept is on show), no build, fails the gate, or passes · 2.10 s, or passes · cached when the build came from the cache), then how many errors and notes are open (1 error · 1 note), and at the right what the text's save is doing when it is not simply saved, and the build target. While a tile builds, a thin bar along its top edge fills. Press it, or ⌃J, for the messages; the panel takes its room from the 3D view rather than covering it, and a view chosen with Iso, Top, Low or Close is framed again in what is left; drag the panel’s top edge to make it taller or shorter (double-click the edge for its usual height; the height is remembered in this browser).
- The panel beside the view, one level of the tile at a time (The panel): crumbs over it (
‹ My tiles › meadow › grass in bank › length
, each one clickable), a line or two under them about what the level sits in, then the level itself, full height. Tile and Source at the right of the crumbs turn the same panel into the document, as written, coloured by kind, and editable (see Editing). - The tile on the plate, painted like the PNG renders, with its squares ruled against an open blue sky. The ⋯ button is Display: paint, overhang, wireframe, grid, projection and all nine views (with Keys and About). The button beside it is Layout. Before a tile has been built, the view frames its footprint, widens to take in each part as the build sends it, and settles on the finished tile; move the view yourself and it stays where you put it.
- Overhang from the gate itself: faces between 55° and 65° are orange, faces past 65° red. The colours come from the gate's own flags, so the view and
buildcannot disagree. - Progress while a tile builds is on the status line: the percentage and the stage; with the messages panel open it is also its first row: the stage, an element's own count (grass blades, wall stones, tree leaves), the time so far against the estimate from the last build of the same tile, and the bar.
Seeing a cloud
A cloud (a top= with a range, or a pin) is drawn as part of the selection, the way a selected region or line is. Put the caret anywhere in a top= value or in a pin line, or click or drag the top field in the property sheet, and that entry's cloud is drawn in the accent over the tile. Point at a line that writes a top, or at the sheet's top row, and it is drawn more quietly.
- A surface's cloud is two sheets over its region, the low and the high, each with a bright edge. A pin is part of its surface's cloud, so the caret in a pin shows the whole surface's. Each sheet is shaded node by node by how often its height comes up: under
low(0dmm .. 3dmm)the low sheet is strong and the high sheet pale, underbellboth are pale, and a plain range shows both at an even half strength. Where a pin holds the top there are no odds and the sheets are even. - A tree's or a rock's cloud is worked out at every branch tip and at the middle of every stone, so each is a short line from its low to its high, shaded at each end the same way, with a marker at the height the roll gave it. A scatter or a grove shows a line for every tip or stone, so you can see where in its cloud each landed.
- A top of one height has no cloud, and nothing is drawn.
The debug layer
When a tile does not come out as you expect, the debug layer shows how the build made it. It is off whenever the editor opens; ⌃⌥D (Ctrl-Alt-D) or Debug layer in the ⋯ menu turns it on and off, and a legend at the top left names what is drawn, with counts. It reads in every view, Top included, and changes nothing that is built or printed.
- Grass: every blade start as a dot coloured by what became of it: grew; grew but cut short; outside the grass's area; too short at a line; too short at the tile edge; too short on bare soil, at a rock or where the flow folds; crowded by a blade already there; under a stone; on bare soil; left out by
cover. Each grown blade's spine is drawn on the ground: blue when it grew to its full length, yellow when it was cut short (yellow, not orange: orange and red always mean overhang), pink for a blade started along the area's edge. Thin dark arrows show the flow the blades follow.
A tile with a great many marks has them thinned evenly, and the legend says so. More elements will add what they do.
The panel
The left of the page is one panel that shows one level of the tile at a time, full height. A level is a place on a path: the tile, one thing of it, one control of that. Nothing opens inline: choosing a row slides the panel to its level, from the right; ‹, a crumb, Esc or ⌘[ slides it back, and the level you left is where you left it (its scroll position is kept). The slide takes about 200 ms, and is a plain swap when your system asks for reduced motion. A map's levels (the map, one piece, a property of it) are the same panel: one shell shows whichever document's level is the one you are at, slides by depth (a deeper level from the right, a shallower from the left, the same for a tile and a map), keeps each level's scroll, puts the keyboard in the new level after a slide when it was in the panel, and reads Esc, ‹, ⌘[ and ⌘] the same. A level's own view only draws what it holds; it never shows, hides or slides itself. The folder levels, the folders of a map's Add step (Add › Places › My tiles › dungeon, each a level, in the trail above the panel and not a second bar inside it) and the step between a folder and a document are steps of the same trail, and slide by the same rule with the same timing, scroll and keyboard: opening a tile or a map from its folder is one level deeper, ‹ or a crumb back to the folder one shallower. There is one function that animates a level change (js/slide.js).
- The trail has gone one level deeper, to the entry.
- The entry: its name, its element and where it stands in the stack.
- Its controls, each with its value; default marks one the document does not write. Press a value to type it.
- › opens a control that has more to say, such as a range.
- Hide and Delete. Hide comments the entry out; both can be undone.
- The entry is outlined on the tile.
- The trail ends at the control.
- One control in full: what it is, its value, how likely each value is, what it takes and how the source writes it.
- The tile is the first level. Its own controls (
size,seed, its description) come first, then the Stack drawn as the tile stands, the top of the tile first and the base last (the reverse of the order it is written and built in; each row's number is its place in that order), each row with its element's colour, its label, where it is put (at=bank), a thickness bar and the height it spans (1.7 to 6.2 mm: the lowest and highest the entry's geometry reaches in the build, in printed mm from the tile's zero, on one scale for the whole stack with the zero a tick; the base hangs below it; a row has no bar until the tile has built) and a dot when messages point at it (red for a mistake, yellow for a note; a number when there are several; hover it for the words). Under the stack is the Shape: the lines and regions, each with a line about what it is. ↑ ↓ move between rows (the thing a row names lights in the view), Home and End go to the ends, Enter opens. - One thing (a stack entry, a line or a region) is the second: its sheet, with Help at the top and Hide and Delete at the foot. A control that has more to say than a row can, such as a range, a count or a height, has a › at the end of its row.
- One control is the third: what it is, its value in a field wide enough to read (checked by the program as you type, and written when you press Enter or leave the field), One number and A range for a control that takes a range, the odds along a range (
flat,low,high,bell,peak,ends: each rewrites the value as the program writes it, and Every form lists all of them with what they take), the names a height can use ($bottom,$groundHeight; press one to put it at the cursor), what the control takes, and the value as the source writes it. Show in source turns the panel to the source with the cursor on that line; Back to the default takes the control out of the source. - The crumbs are the path, all the way from the top: Places, the place, each folder the tile is in (each goes to its folder level, and takes a tile you drop on it), the tile (double-click it, or F2, to rename), then the thing and the control the level is at. A path longer than the bar keeps its end in view and fades at the start. The one you are on is bold. The strip under them says what the level sits in and never repeats the parent's own panel: at the tile, what it holds and the build target; on a thing, the tile's size and seed and where it stands in the stack (
3rd of 5 in the stack · at=bank
); on a control, the thing and the control's value now. - Tile | Source at the right of the crumbs turns the same column into the document. The selection goes both ways: put the cursor on an entry's line and flip back, and the panel is at that entry; flip from a level, and the cursor is on its line. ⌘1 is the source, ⌘3 the levels.
- The view and the panel are one selection. Click a rock and the panel slides to the rock; open a row and the view lights its thing. Click the plate, and the panel is at the tile.
- The address in the browser's bar keeps the level (
#tile=…&at=tile/rock/2&control=size, withface=sourcefor the source; a folder level is#place=…&dir=dungeon/combo, and#place=alone is Places), so a reload lands where you were and the browser's Back and Forward step through the levels you opened. A level the tile no longer has opens at the tile, and says so; a place that has been taken off the list opens Places, and says so. - The rows change the tile. Each row of the stack has a ⋯ beside its chevron (also Shift+F10 or the menu key on a row): Rename… (F2 with the keyboard on a row; anywhere else F2 renames the tile), Hide (comments the entry out,
/-), Delete (Delete), Move up and Move down (⌥↑ and ⌥↓), Add above… and Add below…. A line or a region has Rename… and Delete. Delete and Hide give a line over the view with Undo, never a question; ⌘Z takes back any of them, one step each. A row that this document does not write itself (grass fromlib:parts/grass) says where it is written, and a row a definition call makes (long-grass at=bank) is hidden, deleted and moved as the call. A library tile is copied into My tiles by the first of these, as any first change is. - Add is the first row of the stack (what stands on top), and Add above… and Add below… are in a row's menu. It lists every element: those the plan lets stand there first (
rockanywhere; atreeonly above adirtit can stand on), then, under Cannot stand here, the others with the plan's own reason (it stands on the ground, and the ground is painted after it here: list a
). The answer is the program's: the stack is planned with a default instance of the element at that place. Choosing one writes it on a line of its own, at that place, with nothing set but what it must have (dirtbefore itwall at=the first drawn line,scatter count=3 { rock }, a seconddirtwith the band the checker asks for), and opens its level. If the tile has a mistake there is no plan to ask, and the menu says so. The Shape ends in Add line (a line across the middle) and Add region (a strip along the north edge), each written ahead of the stack and opened. - Move. Press a stack row with the mouse and pull it: it lifts, a line shows the place it will stand, and letting go moves its whole node there (its children, the comment lines directly above it and the comment after it on its line; blank lines stay where they are). Esc while dragging puts it back. A touch screen has the menu’s Move up and Move down. A
scatterwritten inside adirtmoves with the dirt. Stack order is build order, so a move can make an order the plan refuses (a tree above the dirt it stands on): the move is made, the check says why in its own words (a line over the view with Undo, and the message with Go to line in the messages panel), and the rows keep the last good order until the text checks again. It is not blocked on the way: a stack is often put right in two moves. - Names and seeds. A row is called what it does,
dirt in bank, until it is given anid=; Rename… writes (or changes, or with an empty name takes out) thatid=and the row shows it. An entry’s seed is keyed by its path,tile/dirt/0by the count of dirts before it, ortile/dirt/bankby its id, so naming an entry draws its look again once, and then it keeps that look whatever is added, taken out or moved. A move never writes anid=for you: a move across another entry of the same element and no id swaps their counts and so their looks, and the line over the view says so (name them to keep each
). - Pictures in the Shape. A region wears its mask as the build paints it (the program’s own cells, in the tile’s shape, north up), a line its points; a region that covers nothing has a dashed frame.
Places and folders
Above the tile are the folder levels, in the same panel with the same slide, crumbs and strip. Places is the top: My tiles, any folder you have added, then the Library and Tests (read only). A place opens to a folder level: its subfolders first, each with how many tiles are under it, then the tiles in it, each with its name, its size (2×1
) and a small picture of its footprint, the squares across and up, and a dot for its build. A subfolder is another level; a filter above the list searches the whole place, at any depth, and says where each match is. The strip under the crumbs says how many tiles the folder holds (14 tiles (2 here) · 3 folders
) and where it is on disk, as a short path (~/dharmatiles/dungeon/combo
); the library's says library · tiles/ground · read only
. ↑ ↓ Home End move between rows, → or Enter opens, ← or ⌘[ goes up a level (from a place to Places, from a tile to its folder), ⌘] goes back to the tile you left.
- The trail ends at this folder; every step goes up to its level.
- Filter and New. The filter searches the whole place; the buttons make a tile, folder, map or print list here.
- The tiles with their size and a drawing of their footprint, and a mark for the build.
- Have and need, from the inventory, for the base system in the title bar.
- Add a folder. At Places, Add a folder… shows the Mac’s own folder chooser; the folder you choose becomes a place, kept in your settings, and opens at once. Cancelling does nothing. The page never types or sends a path: the program shows the chooser itself, so a page cannot point it at a folder. A folder inside a place you already have, one that holds one, and anything of the library’s is refused with the reason, since a tile would be listed twice or the library made writable. A place you added has a ⋯ with Take off the list: the folder and its tiles stay on disk. The list is in
places.jsonin~/Library/Application Support/dharmatiles/($DT_SETTINGSnames another folder for it); a settings file that is not valid is said at start and never replaced. - In My tiles and the folders you added (the library and the tests are read only) the folder level has New tile (the size picker; the tile is made in this folder and opened) and New folder (a name; the folder opens). Each row has a ⋯ (also Shift+F10 or the menu key on a row). A folder’s: Rename… (F2) and Move to the Trash (⌫). A tile’s: Rename… (F2), Duplicate (
Name copy
beside it), Move to… (every other folder you own) and Move to the Trash. A library tile’s row has Copy to My tiles. - Move by dragging. Press a tile row and pull it: its name follows the pointer, every folder that can take it is faintly outlined, and the one under the pointer lights. Let go on a folder row, or on a folder in the crumbs (to move it up), and the file moves there; Esc while dragging cancels. A tile is never moved over another of the same name, nor into the folder it is in, nor into the library. The line over the view says where it went, with Undo, which moves it back. A tile you have open stays open, on the same level.
- The Trash, never a delete. A tile or folder goes to the Mac’s Trash (
~/.Trash), under a free name if one is there already, and the line over the view has Undo, which puts it back where it was when that place is free. If the Trash cannot be used the program says so and nothing is moved. A tile you have open and have changed asks, as leaving it does, before it goes. - What a call may touch. Every one of these is a call to the program, which checks it again: the place must be one you own, a folder is named by its place’s number and the names below it (no
.., nothing hidden, noout,targetornode_modules), its real path after any links must still be inside the place, a tile must be a.dtilein such a folder, and nothing goes over a file that is there. The list in the page is the program’s answer to the call, not a guess; the folders are rescanned every second as before, so changes made outside the page join it too.
The folder level lists documents by kind, from one table in the program (roots.rs) and one in the page (folders.js): a .dtile that is a tile, and an .stl (shown, and opened to look at; not renamed or moved). A new kind of document is one more entry in each.
The panel is beside the view, on the left or (Panel on the right in the ⋯ menu) on the right; its edge is a sash to drag, or double-click to reset. One button, at the left of the title bar, hides it for the view alone and brings it back (\ does the same). The width is remembered in the browser. On a narrow screen the panel goes under the view.
Selecting
Every triangle of a built tile knows the entry that made it, so the view, the property sheet and the document share one selection: the rest of the tile fades behind it. What is under the pointer shows the same way, lighter: with nothing selected the rest dims a little round it; with a selection, it lifts part way out of the fade. With the fade off, the selection and the pointer's thing are tinted with the theme's accent instead.
- Hover a thing on the tile and it lights up and is named beside the pointer:
rocks in pool · 2 of 3
. - Click to select it. A thing a scatter placed is selected on its own; click it again to climb to the whole scatter, then to the region it is
at=, then the tile. Clicking the plate clears, and the panel goes to the tile; Esc goes up a level. - The panel and document follow: the panel slides to the entry's level and its lines light up in the source. An entry written in a file the tile uses (grass from
lib:parts/grass.dtile) opens that file; Back to the tile returns. - Click a line in the document to select its entry in the view; hover it to light its geometry. A
lineorregionnode selects that line or region on the map. - Double-click, or f, flies to the selection.
- The rest fades. With something selected, everything else eases to translucent in about a tenth of a second; select something else and the two trade places the same way, the new selection rising to solid as the old one sinks back; deselect and the rest comes back (at once if your system asks for reduced motion). The selection stands out by the fade alone and can be seen through what is in front of it. Fade the rest in the ⋯ menu, or x, turns it off, and the selection is tinted instead.
Water owns the surface it fills, so clicking the pool selects the water; put the cursor in the ground's line to reach the ground beneath it.
Editing
Every change is a change to the document's source, and the source is the tile: what you change in the view you can read, and keep, in the file.
- Source turns the same column into the file.
- The text is the tile. Edit it and the tile builds again; a mistake is marked on its line.
- The view carries on beside it.
- Start fresh. New tile makes printable flat ground in the folder you are in (My tiles at the start), in a file called what you name it, at 1×1, 2×1, 1×2 or 2×2 squares, ready to change in the same editor.
- The sheet. Selecting an entry slides the panel to its controls: every control the element has, written or not. A control that is not written shows the value a build would use, faint, and says where it comes from beside it:
default
,from style brick
(a wall’s style picks its stones’ size, joints and bond),from crown branching normal
(a tree’s branch numbers),from parts/edges
(the library’s edge defaults, for a body’stop), or, for a value written in a part the entry calls, that part. Where leaving a control out has no number to show, the words say what it means (a plain line, no strip
,a mix of all three
), and a control the build does not take yet saysnot built yet
. The program works each one out, from the same table the build reads, and the page only shows it; the sheet never saysnot set
. Change an inherited value and it is written (the mark goes); × takes it out again. A group’s controls (a wall’sstones,jointsandedges) are rows of their own, named by their path (stones height). Help is always at the top right; Hide and Delete stay at the bottom. Drag a number sideways to change it (Shift for fine steps), or click it to type. A short word control shows its choices directly; larger sets use a dropdown so the sheet stays aligned. A switch flips; × takes a control out, back to what it inherits. Everyseedhas a die beside it: press it for another arrangement. On the tile’s ownseedthe die lays five small pictures of the tile under the row (the seed it has now first and four new ones, each built low at its seed in the background when you press it, at most five at a time and kept until the page closes); a square on a picture marks a seed you have printed. Press one to use it (one step of undo, the source saysseed=…), Roll again for four more, Close to leave it as it is. A map piece’s Seed level has the same die and the same strip (one component), and choosing one sets that piece’s seed. An entry that writes its ownseed=keeps it when the tile's seed is rolled, so a quiet line under the row says so (wall keeps its own seed (15)
, orwall and flagstones keep their own seeds
) and pressing a name selects that entry. A scatter's sheet holds its things' controls too. Only the value changes in the text: the layout and comments stay. - Lengths as written and as printed. A length in the sheet reads as written, with its unit (
7 dmm); hover the unit for what it is (the program's own words:dmmis the design millimetre, 1/35 of a square). Beside it, quieter, is what it prints on the build target in the title bar (7 dmm · prints 5.08 mmon OpenLOCK), the program's own working out, shown only where it differs from the number written (not formm, nordmmon DungeonBlocks). Typing a value is literal. Click a printed number to type a printed size instead: it is written back in the value's own unit (5 against7dmmon OpenLOCK writes6.89dmm), to 0.01 mm of printed size with the fewest decimals; each end of a range is typed on its own, and a formula only shows its printed size. A range reads3.5–6.5 dmmin the sheet (the source keeps..), a count of nothing reads none, and a map piece's place reads column 1, row 1, counted from one. See Written and printed in the editor. - Weighting a range. The › at the end of a range's row opens its control level, where
flat,low,high,bell,peakandendsare buttons that wrap the range (size="6dmm .. 10dmm"becomessize="low(6dmm .. 10dmm)"). Clicking the value itself opens a pop-up with what the control takes and three forms: one number, a range and weighted, which on a plain range pickslow. The weighting is written in the field,size="low(1dmm .. 6dmm, 4)", and the pop-up checks what is typed with the program’s own message (dt::range) in its check line. - Typing. The document is checked as you type, without building: a mistake is underlined at its line, marked in the gutter (hover the mark for the message) and said in words under the source. Long lines wrap, each continuation indented under its line; ⌘F finds and replaces; a
{block folds from the arrow beside its line; brackets are matched and closed; ⌥-drag or ⌘-click makes several cursors. Completion offers element names at the start of a node, an element's controls on its line, and aftername=the control's words, or the document's regions and lines. Ctrl-Space asks for it. - Drafts while you drag. As a value is dragged, the view shows quick drafts of the tile: fewer cells, the parts not joined, and overhang judged face by face. A cliff's draft carves its faces on a coarser grid and leaves the stone's grain off, so it answers in about two seconds. A draft of more than 400,000 triangles is thinned for the view. The verdict says draft beside it, since a draft is never judged by the gate. Let go and the full build follows.
- Saved as you go. A change is written to the file half a second after it reads cleanly, and the tile rebuilds. A source with a mistake is kept in the page, unsaved, until it is fixed. If you leave while it cannot be saved, the editor makes discarding explicit. If the file changes on disk under unsaved changes, you choose which to keep.
- One history. ⌘Z (Ctrl-Z) undoes typing and changes made in the property sheet alike, and on a map or a print list the changes made there too (pieces, counts, pins, the printer and the plates' settings, the saves of the Source); ⌘⇧Z redoes. A map or print list is written by the program, so each of its steps is made against the revision of the file the history left, and a file changed since (another tab, your text editor) is refused, with the reason, and its history ends. Undo and Redo also live in the title bar: press either for one step, or open its arrow to inspect the action history and jump several versions at once. Each action shows a short monospace excerpt of what it added and, when applicable, what it removed. On a tile’s own text, while the arrow’s menu is open, each row also shows two small pictures: the tile as it is now and as choosing that row would leave it (two seed rolls are two different pictures, not two identical sentences). The program builds each past text at the lowest tier on its side lane, never on the lane an edit builds on, keeps the picture by the text (a text built once is not built again) and stops building what a closed menu no longer shows; a text with a mistake in it shows that in place of a picture, and the message is its tooltip.
- Rename. A tile's file name is its name. Double-click the name in the editor's header, or press F2, type the new name and press Enter (Esc cancels). The file is renamed in its folder, never over another tile, and the undo history comes with it. Library tiles are made yours first.
- The first change to a library tile. Library tiles are never written, and the editor does not ask about it: a small library chip beside the tile's name says what it is, and the first change you make (a key typed in the source, a value in the property sheet, a gesture in the view) copies the tile into My tiles, its
uses pointing back at the library, and makes that change in the copy. Nothing you typed is lost. One line over the view says where the copy is, with Undo: it takes you back to the library tile and deletes the copy.
Only a page served by this run of the program can change a file: each change carries a secret the page reads from the program, and a page from any other site is refused.
Placing and drawing
The bar under the view puts new things on the tile. Type an element, a definition of the document, line or region (A goes there), choose with the arrows and press Enter; anything after the name, such as rock size=12, is written with it. Each gesture writes one node into the source, saves it, and selects what it made. Esc puts the tool down.
- Things (
rock,boulder,tree, a definition): its footprint follows the pointer with the point in squares from the north-west corner; a click writesrock at="(0.64sq, 0.58sq)"at the end of the stack. Click again to place another. - Surfaces (
dirt,flagstones,planks,water,grass): the region under the pointer lights up; a click writes the entryat=it, or for the whole tile outside every region. - Scatter: click or drag in a region to write
scatter at=pool count=3 { rock }, with its property sheet open on the count.scatter boulderscatters boulders. - Walls: click a line, or near an edge, to write
at=it. - Lines: click points on the plate; Enter or a double-click ends the line, Backspace takes back the last point. A point by the middle of an edge or a corner snaps and is written as its word (
north,south-east); one close to an edge goes onto it. - Regions: click inside the area the lines enclose; it writes
region area-1 { boundedBy …; fill "(0.5sq, 0.75sq)" }(a point counted from the north-west corner) naming every line, for you to rename and trim. - Handles. A selected line shows its points, a region its fill points, a placed thing its
at=: drag one to rewrite that point. - The map. Only what you are working on is drawn over the tile: a selected line, drawn as a labelled ribbon at zero with its wobble's band, or a selected region. A selected region is the selected item: it is drawn opaque in the accent, flat at level zero (where the base meets the tile body), with its name, and the rest of the tile fades so you see down through it to the region, from any angle. The places it is made from are drawn and named beside it at zero, in periwinkle: a line or tile edge as a line and another region as an outline with a faint fill (the lines a bucket region is
boundedBytoo). While a tool is held every line and region shows faintly (regions at zero), so you can aim at them. With nothing selected the tile is shown bare. - Control points. A selected line or region marks every point it refers to: each
throughpoint of a line; eachfillpoint of a region and eachwithin … of=centre that is a point. Every one is a plum dot at zero with its label beside it: a literal shows its coordinates as written (0,0.38,(1.5, 0.7)), a named point or corner or edge word shows its name. A point drawn from a range or written as an expression is labelled with its source text, as a ring at the middle of where it may land. Positions and spans come from the program's own reading of the source. - Hide and delete. The property sheet's Hide writes
/-before the selected node, so the tile builds without it and the document says so. Delete takes the node out of the text. Both offer an immediate Undo.
Moving round a tile
Orbit with the left button, pan with the right button or Shift, zoom with the wheel or a pinch, toward the point under the pointer. A fling keeps turning and settles. Picking a view turns the tile there rather than cutting; moving the camera clears that preset. The page tells the view what it shows and the view decides its own camera: a view you moved stays through rebuilds and edits, and each tile (and each map or plate list, in each of its views) comes back as you left it when you open it again. The shortcut row always holds ISO, Top and the two most recently used other views; all nine remain in ⋯.
| Key | Does |
|---|---|
| 1–9 | Views: iso, top, front, right, back, left, low, close-up, under |
| p | Perspective or orthographic, keeping the view |
| c | Paint on or off (off is plain grey plastic; overhang colours stay) |
| o | Overhang colours |
| w | Wireframe |
| g | The grid on the plate |
| t | Light or dark |
| ⌃⌥D (Ctrl-Alt-D) | The debug layer |
| f | Fly to the selection |
| A or / | The bar: place or draw |
| \ | Hide or show the panel |
| Esc ⌘[ | Up a level of the panel (from the tile, ⌘[ goes to its folder; on a folder level, up to its parent, then Places) |
| ⌘] | Back down the level you left |
| ↑ ↓ Home End Enter | In the tile level: move between rows; open one |
| ⌘1 ⌘2 ⌘3 | Put the keyboard in the source, the view, the tile's levels |
| ? | Every key, in the editor |
| ⌘F | Find and replace in the document |
| Tab / Shift-Tab | Indent or unindent the selected document lines |
| ⌘S or Ctrl-S | Check and save now |
| Esc | Put a tool down, close a menu, else clear the selection |
Single keys work when the document is not being typed into. Choices are remembered in the browser. With reduced motion set in your system, views cut and nothing coasts.
The build target
On a print list or a map the chip names the printer that document uses (Bambu Lab X1 · this map
), read from the document as it is now, as the status line does; its card changes that document's printer, and Undo takes it back. Elsewhere the chip at the right of the title bar names what every build is for: the base system (DungeonBlocks or OpenLOCK) and the printer profile, such as DungeonBlocks · default
. Click it to change either. The tile you are looking at, and every other tile you have built, builds again for the new target; the gate's angles and the numbers in the record are the chosen printer's. The choice is remembered in $DT_HOME (else ~/dharmatiles) for the next run; --system and --printer on the command line start the run on another one. Each printer is listed by the squares that fit its bed (6 × 6 squares · 1 colour · 220 × 220 mm
) and drawn at one scale with those squares in it, using the square of the base system chosen above (35 mm for DungeonBlocks, 25.4 mm for OpenLOCK); choosing the other system redraws every bed. The slicer imports are one menu, Import from a slicer. The printers are the library's (library/printers/) and your own: a printers/ folder beside your tiles, one .dtile file each, named like the file (see Printing and Printers, where a profile is also a machine, by brand and model, such as bambu/x1c). There is no both
: one build is one target. With a print list or a map open, the chip names that document's own printer (Bambu Lab X1 Carbon · this map
), and choosing a printer in its card changes that document's plates line, as its plates panel does; the base system there stays the one tiles build for.
- The card: the base system, then the printer, from the library, from your own profiles and from slicers you import.
- The chip in the title bar names the target and opens the card.
Export
Export, beside the verdict, runs the same build as dharmatiles build on the saved file and writes it to out/: the project's (beside the nearest dharmatiles.dtile above the tile), else one beside the tile, as out/db/my-tile-db.stl. A library tile is never written into the library: it goes to out/ in My tiles (~/dharmatiles/out/db/ground/1x1-grass-db.stl). The card says where before you export. It builds for the build target in the title bar, written to out/<target>/ (out/ol-fine/my-tile-ol-fine.stl for OpenLOCK and the printer fine); choose Also a painted 3MF for a 3MF painted by material (a Bambu Studio project when ~/dharmatiles/bambu.3mf exists; see Printing). Reveal in Finder shows what was written. Export waits while the tile builds or has unsaved changes, and is refused, with the reason, while the tile fails the printability gate.
Plates
A .dmap in a folder is a print list: open it and the view shows the printer's bed, its edge and any excluded zones, with one plate on it, and the panel becomes the plates' panel. The Tile and Plates switch in the title bar follows what you have open.
- Plates lists each plate with its pieces and filaments; press one to see it on the bed. When grouping pieces by filament costs a plate, a note says how many and offers Pack by size only.
- Making a list. New print list in a folder you own, Add to print list on a tile or a tile row's menu, and Pieces in the panel (count and remove) edit the
.dmapwith Undo; the Tile and Source switch shows its KDL (see Plates). - Export builds every piece in full and writes one Bambu Studio project, or one STL per plate for any other printer, to
out/plates/. The status line and the messages say what it is doing and the files it wrote. - Printer is brand, then model, with a switch for the AMS on a Bambu printer; Print mode is single or multicolour and the grouping, with the check that the printer has the filaments; Spacing is the gap, the margin and turns. Each change rewrites the list's
platesline and nothing else. - A tile with no full build kept shows its draft build, marked draft · not yet checked in the status line, while the full builds of the pieces on the plate in view run; when they land the plates are laid out again by what the full builds cover. The other plates' pieces build when you export. A plate drawn from draft meshes is never exported.
Maps
A map is a .dmap with placed pieces, and the title bar's Map is its view: every piece's tile at its place, turned and raised, in the same 3D view, on the ground of the backdrop you chose (Wilderness, Cavern, Table or Plain, in the ⋯ menu; the choice is kept in this browser and used for the tile editor too, and the plates keep the printer's bed).
- The panel goes from the map (its pieces by tile with have and to print pills, Add tiles, Print what's missing, the variants) to one piece (place, turn, bottom, seed, print setting, Open tile, Duplicate, Remove) to a property (the level's names, the seeds you own as chips).
- Add tiles, a step of a map (maps), shows this folder level with a picture for each tile: press a tile to put it down, or drag it to where it should stand. The folders it walks are steps of the editor's one trail, left by ‹, Esc or a crumb like any other level. New map in a folder you own starts an empty one.
- Moving works in a view looking down (Top): drag a piece, or the selection, and it snaps to the squares of its own system. R turns, D duplicates, ⌫ removes, ⌘Z undoes the last change; every change is an edit of the text, with the toast's Undo.
- Detail by distance. Each piece is drawn distant (super-low), draft or full by its size on screen, under about 900 000 triangles in all; full is asked for only when close, never blocks, and what is not full is marked draft · not yet checked in the status line, once, with how many pieces are full, drafts or distant.
Inventory
The inventory is a file, inventory.dinv, listed in My tiles once it exists. In the page it is four things: have and need pills on a tile's row in a folder (for the system the title bar's chip names), 3 printed · seeds 7, 12, 97 with I have this on a tile's level (it adds one good print of the tile's seed, in the colour mode you pick, without exporting), N in inventory · M to print and After the print in the plates' panel, and the document's own view, opened like any document: the pieces grouped by tile with filters for system, colour and have, Gone and Reprint on each piece, a one-click Re-link for a tile that moved, and Source for the file's KDL. Renaming or moving a tile in My tiles adds a renamed line, so the counts follow it.
Live updates
Save the document, or any file it uses, and the tile rebuilds. Your camera stays; the old tile fades at once, so it never passes for the new one. As the build goes, each stage's parts take its place, faded too: the ground within a moment, then each element as it finishes. A cliff shows its rough blocks within a second or so, long before its stones are cut. What stands for work still going breathes, its transparency rising and falling: the rough blocks, and the old tile until the first new part arrives (not with reduced motion). Opening a tile mid-build shows what it has made so far. The finished tile replaces them all, solid, with its verdict. What shows while a tile builds is never judged by the gate, and a large stage is sent thinned. A rebuild starts from the first step your edit changes: the program keeps the tile as it stood after each step of the last build (in the order the plan runs them, surfaces and ground first), so changing the boulders by a cliff rebuilds the boulders and joins and checks the tile again, in about two seconds, without carving the cliff again. Changing a surface, such as the dirt's level, rebuilds everything after it. The last few tiles you worked on keep theirs; drafts keep their own. A mistake shows over the view as file:line:column with a hint, in front of the last good build; the next good save clears it. One tile builds at a time: tiles named on the command line are built at the start, and a tile picked from a folder is built when you pick it.
If the program stops, the page says so the way it says a build is running: the status line says reconnecting… with a pulsing dot, and the tile fades and breathes. Start the program again and the page carries on by itself, whenever that is: it finds your tile again by its file, rebuilds it if it needs to, and keeps your camera. An edit typed while it was away is kept and saved once it is back (the title bar says not saved yet until then).
The cache of builds
A tile that has been built once is not built again until something it depends on changes. Every finished build is kept in one cache folder, under a key that is a hash of everything the build read, so a build that is found there is the build, byte for byte: the same STL, the same paint, the same gate verdict. Open a tile whose build is kept and it is on screen at once, with no build; the status line says passes · cached and the messages say From the cache (2.1 s when it was built), then the gate's verdict as for any build. dharmatiles build and build --all read the same folder (they still write the STL), so a second sweep of the library takes seconds, and Export reuses the build you were looking at.
- What the key covers. The tile's path and text, the path and text of every file it used (
useandlib:parts, read from disk), the base system, the printer profile (its name and every number in it), a seed given with--seed, the tier (full, low or super-low, and the editor’s draft; a finished build is never answered with a preview, and the three tiers of one tile are three entries) and the engine: the program's version and a hash of the source that decides what a build makes. The label a build record carries is not in it, so a hit writes the label of the program that asked. - No stale geometry after a code change. The engine part of the key is computed when the program is built, from the contents of the crates a build runs through, the lock file, the toolchain, the vendored kernel and the one library file compiled in (
parts/heights.dtile), whether or not they are committed. Edit the geometry code in a checkout and every old entry stops matching; leave it alone, or change only the command line, the editor or the docs, and the cache stays. The rest of the library is read at run time and is in the key by its text, so editing a library tile or part misses by itself. - Where it is.
$DT_CACHE, else~/Library/Caches/dharmatileson macOS,$XDG_CACHE_HOME/dharmatiles(else~/.cache/dharmatiles) elsewhere. It is a cache, never beside your tiles: nothing in it needs to be kept, shared or committed, and clearing it only costs the time to build again.DT_CACHE=offswitches it off. - How big. At most 4 GB by default (
$DT_CACHE_LIMIT, such as500MB). Past the limit the entries used least recently go first; reading an entry counts as a use. A write is made to a temporary name and renamed, so a run that stops half way, or two runs building one tile at once, leave whole entries. - An earlier build while the new one runs. Change a tile, or a part it uses, and open it in a fresh run: if the cache holds an older build of that tile for the same target, it shows at once, the status line says rebuilding with the progress, and a message says which build it is (Showing the build made by 1.0.0+… 3 h ago while the tile builds). The new build replaces it when it lands, and the note goes; if the new build fails, the old one is taken off rather than left to pass for the tile. A tile that is already showing its last build keeps it as before.
- Tiers. A tile has three: full (the union and the gate: what prints and what Export writes), low (the editor says draft; about 15 000 to 35 000 triangles, for browsing and the map when near) and super-low (at most 12 000, for the map when far). A low build is made on purpose, not cut down from the full one: the same places (every rock, tree and flower stands exactly where the full build puts it, because the lattice is the full one; a grass clearing, placed round the rocks as drawn, may differ by a few millimetres), drawn with less detail. Rocks are their hulls, grass is a lumpy carpet where the blades would grow (fewer blades would read as bare earth), a tree is smooth branches and rounded clumps without leaves, a wall is sharp blocks, a cliff is carved on a coarse grid, the ground is meshed within a third of a millimetre, the connector has no logo. Nothing is joined and nothing is judged: each face is flagged by its angle, so overhang is still red and orange, and the verdict reads draft · not yet checked. A draft or distant (super-low) build is never printed or exported:
dharmatiles build --tier low --pngwrites the views alone and refuses--3mf.GET /api/tiles/ID/tier?tier=low(orsuper-low) answers the page’s mesh at a tier for a map that draws by distance. The tile editor keeps its way: the draft while a value is dragged, the full build on save; a low tier shows only as the stand-in while a tile builds and nothing earlier of it was kept. - Previews of the library.
dharmatiles cache previewsbuilds the super-low tier of every library tile (about 0.7 MB each, 41 MB for the whole library on one base), into the cache, once for each base (--system ol);--into FOLDERwrites them to a folder laid out as the cache is, for an install to copy into the cache folder, so the library opens with something to look at the first time. A release or an install runs it; the generated files are never committed. A tile with only a preview kept shows it, marked rebuilding and low · not yet checked, while its full build runs. A preview is for looking: it is never a finished build, and never what Export writes. - It does not hide failures. A damaged entry (a file cut short, a flipped byte) is reported where you look, as a warning in the messages and on the terminal (the cache entry … is damaged (its checksum does not hold); it was removed, so this build is made again), and the build that replaces it is a real one. An entry that cannot be written, or a limit that is not a size, is said too;
build --no-cachebuilds from nothing and keeps nothing. - The commands.
dharmatiles cacheshows the folder, how many entries it holds, their size and the limit;cache listshows each entry (what it is a build of, its target, its size, when it was last used);cache clearempties it.
An entry made on another machine is not trusted: determinism is tested on this machine, so copy only the library's previews, which are for looking, never a build to print.
Messages
Everything the program learns about a tile (a check, a build and how long it took, the printability gate's verdict and numbers, an export, a mistake, a note, a failure) is one message in one stream. The status line, the panel, the marks in the source and anything that reads the stream are views of it, so none of them says anything the others do not.
- The panel rises over the view when you press the status line or ⌃J.
- Filters: all, errors, notes, build.
- The verdict: how long the build took, whether it passes the gate, and two bars of overhang against the budget.
- A note is yellow: something the checker saw in a tile that is fine. Show on tile goes to its place.
- The status line says the same in a few words.
- The panel rises over the lower part of the view when you press the status line or ⌃J. Its top row is the work in flight for the document: a tile’s build, or on a map the loading of its pieces (Loading the pieces of first-plate, the piece being built, pieces done of pieces asked, and an estimate once one is done), one record that the status line’s word (building or loading) and its bar read as well; while it runs, its stage, the time against the estimate and the bar; when it ends, its record: Built in 2.1 s · passes the printability gate, with the gate's verdict under it as two bars, Past 65° and 55 to 65° band, each full at its budget and red past it with the multiple written in the bar (16×), the used and the allowed area beside it, and beside the bars the underside: the tile seen from below with the faces the gate painted in the colours they have on the model (red past 65°, orange in the band), so you see where the overhang is without turning the model over (drawn from the mesh the view holds, the same flags the view paints, so it never disagrees with the gate; nothing is drawn when no face is flagged); and everything else (triangles, dropped bodies, holes, voids, the seed) folded under Details; and Show worst face, which flies to the largest red face (or the largest orange face when there is no red). Under it, every open message is a row: its severity (red for a mistake, yellow for a note), its code, the words, the help, where it is, and its actions: Go to line, Show on tile (the stack entry it is about) and a copy icon that copies its details. All, Errors, Notes and Build filter the rows; Copy all copies the tile's open messages as text. The legend for orange and red is at its foot.
- A mistake leads with its sentence. Each row says what is wrong in words (the word it is about set in mono, the hint under it), then where it is and its
dt::code, quiet, last. Pressing the row goes to its line in the source. When the tile does not build, the view carries a card in the plate's own light colours with the first error in its words, Go to line and All messages, so the place you look says what is wrong. - A suggestion is a button. When the program knows the word you meant (did you mean
dirt?), the row, the card and the tooltip of the mark in the source carry a button that makes the change (Change to dirt), one step of the history you can undo. The program writes the words and the edit together (dt_doc::error::suggest); the button applies the edit only to the text it was found in, so after you have typed on it waits for the next check. Where the program has no replacement there is no button. - Explain sits beside the buttons of a message with a
dt::code. It opens that code’s page (what happened, what to do, a broken document and its fix, and the rule it comes from) from the copy of the docs installed with the program, so it matches the program and works with no network. The same words are in a terminal withdharmatiles explain dt::type; every code is listed on Error codes. - Notes are things the checker saw in a tile that is fine, such as
dt::steep(a pin forces the dirt steeper than its slope) anddt::edge. They are yellow, and show the same marks in the source's gutter as a mistake does, in yellow. - A message stays until something fixes it. A new check or build of the same tile clears what it no longer reports. While a build runs, the rows from the last build stay, dimmed and marked from the last build, and the old tile stays faded in the view; when it finishes, what it fixed goes (one quiet line says 1 cleared by this build) and what is still true comes back at full strength.
- The marks in the source: a square in the gutter and a wavy underline on the line of a mistake, and a yellow one for a note, for a mistake the build finds (
dt::look) as well as one the check finds. Pressing the gutter mark opens the panel at its message. - A failure of the program's own (a file it could not write, a panic) and one of the page's join the same stream, with the chain of errors and both stacks behind the copy icon. See Errors.
- An assistant reads the same words:
GET /api/messages?tile=NAME&state=open&format=texton the preview's address (since=Nfor what came after sequence number N;format=jsonfor the stable JSON form).
When something goes wrong
A mistake in your tile shows where you made it: beside the line (a mark in the gutter and a wavy underline, for a mistake the build finds as well as one the check finds), in the messages as file:line:column with a hint, and in the status line (1 error); a tile that fails the printability gate says so there too. Those are not failures.
When something breaks that is not your tile's fault it is a message too, in red, in the same panel. A failure the program can explain, such as a file it could not write, says so in its own words, with what to do. Anything else says what it was doing and the technical words under it. The row's copy icon puts a report on the clipboard to paste into a bug report: what happened, the page's stack and the program's backtrace and causes, and the dharmatiles version, build target, tile, browser and time. If the browser will not let the page copy, the icon says so. A row of a failure has an × that puts it away. A mistake in your tile is listed at its line (Go to line), and every row, mistake or bug, copies its code, where it is, its source lines and this environment.
Paint
Every material is painted like a quick acrylic job: a dark basecoat, mid tones, and pale highlights drybrushed on whatever stands proud, so joints and cracks stay dark and edges catch the light. Each material's ramp is a line in library/palettes/default.dtile. Give your own copy to dharmatiles preview --palette my.dtile, which repaints when you save it, or to build --png --palette my.dtile.
Limits
- Seeds, sweeps and the deferred assistant are designed but not built: see the editor. The map shows a region's area as the last good check made it; a line moved by its handle redraws when the text next checks.
- Made for your own machine: a finished tile's mesh is sent whole (about 94 bytes a triangle), fine on the loopback, not meant for a network.
- A build reuses only the steps before the first one an edit changes: a change to a surface or an early element rebuilds a tile with a tree or a cliff in full, in seconds, not at once. Joining the parts and the gate always run on the whole tile.
- No section cuts or measuring.