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.
Your first program
Section titled “Your first program”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 squarethrough .a .cthrough .b .dpaper 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 .dRun it yourself
Section titled “Run it yourself”beloch fold examples/diagonals.bel | bun tools/fold2svg.mjs - out.svgbeloch fold writes FOLD JSON to stdout; fold2svg.mjs converts it to SVG.
You can also pipe the JSON into any FOLD-compatible viewer.
Next steps
Section titled “Next steps”- Your first fold — add a
@mapstatement and see both crease pattern and folded state - A tour of the axioms — all seven Huzita–Justin axioms in Beloch syntax