purlhaps

Knit the swatch in your browser before you knit it for real.

purlhaps is a knitting simulator. You write a stitch pattern in a small text language, it works out how each loop pulls through the one below, and it shows you the fabric in 3D.

The point is to answer "what if" questions cheaply. What if brioche, but with two slips? What if the float goes in front? What happens when I forget the decrease? You change one line and look at the result instead of casting on again.

How it works

What a pattern looks like

Brioche, and two ways to read "brioche, but with two slips":

pattern brioche
  cast on 16
  row setup: *sl1yo, k1*
  row 1: *sl1yo, brk*
  work setup
  work 1 x 23

# Two slips in time: each column is slipped on two rows running.
pattern brioche-held-2 from brioche
  row 1: *sl1yo, brk*
  row 2: *p, sl1yo*
  row 3: *brp, sl1yo*
  row 4: *sl1yo, k*
  work setup
  work 1 2 3 4 x 6

# Two slips in space: pairs of columns instead of single ones.
pattern brioche-2x2 from brioche
  row setup: *sl1yo, sl1yo, k2*
  row 1: *sl1yo, sl1yo, brk, brk*

Variants can also swap stitches outright. Here a slip-stitch rib gets its floats moved to the front:

pattern slip-rib
  cast on 15
  row 1: k1, *sl1, k1*
  row 2: *p*
  work 1 2 x 10

pattern slip-rib-front from slip-rib
  replace sl1 -> sl1 wyif

purlhaps is an early prototype. The stitch set, the language and the physics are all still changing.