r/PlotterCode • • 13d ago

draw.land

Post image

Hey everyone,

I’ve been down the drawing machine / pen plotter rabbit hole for a long time, and my other big obsession has always been cartography.

Anyone who has tried plotting maps from standard GIS or vector tools knows the usual headaches: polygons come out as empty outlines instead of hatches, layers draw right over each other turning ink into mud, text is outlined instead of single-stroke, and cleaning up hidden lines in Inkscape or Illustrator takes hours.

So I built draw.land: https://draw.land

GitHub repo (MIT licensed): https://github.com/piLeoni/drawland

It takes OpenStreetMap data, vector tiles, elevation/bathymetry, and GeoJSON feeds, and draws them the way a physical pen actually works:

• Pen-plotter fills & terrain: Buildings hatched individually, parks stippled, water in waves, tree crowns as isoline stacks, and pen-and-ink terrain hatching (burin style) alongside contours and depth soundings.

• Declarative hidden-line removal (masks): Roads automatically clear the park dots and water waves underneath them; buildings knock out everything under them; street labels clear a halo across whatever they cross. No overlapping ink puddles.

• Made for the machine: Output is in real paper units (mm / in) at an exact cartographic scale (1:8000, etc.), with one SVG group per pen. It handles path merging, simplification, sorting, stroke de-overlapping, single-stroke fonts, a hand-drawn tremble option, and slicing large posters into tiled sheets.

• Projections & warps: Web Mercator, UTM, any PROJ string (e.g. polar stereographic), or custom mathematical warps written directly in the script (log-scale distance from center, fisheye, twirl, etc.).

How it works:

Instead of clicking through menus, a map style is a short declarative script (a profile in JS/TS, or built directly in Python, Node, or Rust). For example, ~20 lines of code grab the map tiles, fill the water with waves, hatch the roofs at 45°, and mask the layers cleanly.

Two ways to use it:

  1. In the browser (nothing to install): https://draw.land runs the Rust engine in WebAssembly right on top of the map. Place your paper card anywhere in the world, pick a style (or edit the script live with autocomplete), and export SVG, PNG, DXF, or G-code (whole, per sheet, or one file per pen).

  2. CLI / Code (MIT open source): available via cargo install drawland-cli, pip install drawland, or npm install drawland. You can run drawland map --address "Piazza Maggiore, Bologna" -o map.svg from the terminal, or build the graph in Python, Node, or Rust.

I also published the core geometry pieces as standalone open-source libraries if you want to use them in your own non-map plotter code:

• penfill (pattern fills inside polygons): https://github.com/piLeoni/penfill

• burin-map (pen-and-ink terrain drawing): https://github.com/piLeoni/burin-map

• terramask (vector & terrain tiles to polygons): https://github.com/piLeoni/terramask

• deoverlap (stroke de-overlapping): https://github.com/piLeoni/deoverlap

Full gallery and docs are at https://draw.land/docs — I’d love to see what you plot with it or hear any feedback!

13 Upvotes

4 comments sorted by

2

u/GuaranteeRude5070 13d ago

Very cool! The SVGs look amazing. Can't wait to plot

1

u/BaudRate115200 13d ago

I would love your feedback and to see the result ⚡

1

u/GuaranteeRude5070 1d ago

My plotter is not exactly "state-of-the-art", as I built it myself, but here's my first plot using your code. The docs read well and the interface is clear and straightforward.

Not necessary or urgent in any way: but it might be nice to have an interface to add "PLACES" to the "Square One" gallery preset, but that was the only thing I encountered that tripped me up at all. I do see the const PLACES = [] in the Script, but the interface would be a convenience.

1

u/Standardw 1d ago

looks great! I'd love to change the style a bit though, for example in the frog mode, reducing the clouds, enable or disable street names or stuff like that. Also, when resizing the frame, I cannot change its ratio with the resize button. Last but not least - when I change the art style, I dont want it to change location again :(

Great work!