Skip to content

Getting started

Beloch is a declarative language for origami, named after Margherita Piazzola Beloch. You describe points, lines, and folds; Beloch evaluates them into a crease pattern and a folded state.

A Beloch program starts with a paper declaration — the sheet of paper you are working with — followed by a sequence of operations. Here is the simplest useful program: a square sheet with its two diagonals.

paper square
through .a .c
through .b .d

paper square sets up a unit square with corners .a (bottom-left), .b (bottom-right), .c (top-right), .d (top-left). Each through call draws the line through two of those points — axiom 1.

; status: works — both diagonals of the square
paper square
through .a .c
through .b .d
.b .c .a .d axiom 1 · through
diagonals.bel
Terminal window
beloch fold examples/diagonals.bel | bun tools/fold2svg.mjs - out.svg

beloch fold writes FOLD JSON to stdout; fold2svg.mjs converts it to SVG. You can also pipe the JSON into any FOLD-compatible viewer.