Pen-plotter geometry library (inspired by PGS): hatching, image halftone (lines or circles), circle packing, triangulation / meshing, boolean path ops, Voronoi, tilings, and SVG I/O for Node and the browser.
Stroke marks only — solid area fills are not the goal.
Status: Built entirely with AI as an experiment. Not meant for public / production use yet. Feedback welcome via GitHub issues on the repository.
pnpm add pattapattaRequires Node ≥ 18 (ESM). Works in modern browsers via bundlers.
import { createRect, union, hatchParallel, toSvg, group, segmentsToOpenPaths } from 'pattapatta'
const a = createRect(0, 0, 2, 1)
const b = createRect(1, 0, 2, 1)
const merged = union(a, b)
const strokes = hatchParallel(merged.paths[0]!, { spacing: 0.08, count: 40 })
console.log(toSvg(group(segmentsToOpenPaths(strokes))))pnpm dlx pattapatta --help
pnpm dlx pattapatta svg:roundtrip in.svg -o out.svgLive: pattapatta.madorkestra.com (GitHub Pages; deploys on push to main).
For AI agents: llms.txt (index) and llms-full.txt (full API dump). Explainer: /llms-txt.
Local documentation PWA (SvelteKit + shadcn):
pnpm install
pnpm docs:dev
pnpm docs:build
pnpm docs:examples # regenerate SVG figures (+ llms.txt)
pnpm docs:llms # regenerate llms.txt / llms-full.txt only| Import | Role |
|---|---|
pattapatta |
Types, SVG, all facades |
pattapatta/shapeBoolean |
Union / intersect / subtract / occlusion |
pattapatta/hatch |
Parallel / cross hatch fills |
pattapatta/halftone |
Image tone → lines or circles |
pattapatta/circlePacking |
Lattices (overlap | contained), LEC, stochastic |
pattapatta/triangulation |
Earcut, Delaunay, Poisson Steiner, refine |
pattapatta/morphology |
Buffer, simplify, warps |
pattapatta/meshing |
Graph faces, quadrangulation, mesh process / repair |
pattapatta/voronoi |
Voronoi cells |
| … | See website/ API pages |
MIT — clean-room implementation (not a GPL line-port of PGS). See docs/decisions/.
Source: github.com/MadOrkestra/pattapatta · Issues · Sponsor · Buy Me a Coffee