Home /  Sketchbook /  p5.js - Frieze Pen
  • Info

Overview

This is a p5.js sketch that allows you to draw a Frieze.

It was inspired by Ch. 30 “Strip Friezes” of Barrow’s 100 Essential Things You didn’t know you didn’t know about Math & the Arts (amazon.com).

Controls

  • Keyboard:
    • p Will save the canvas as a PNG to your computer.
    • c Will clear the canvas and allow you to start over.
  • Mouse:
    • Click + Drag (within the lighter grey area) will draw a line, which will be repeated based on the Frieze settings.
  • URL parameters:
    • tileWidth=### will set the width of the light grey drawing area.
    • tileHeight=### will set the height of the light grey drawing area.
    • transform=hvt Will configure the transformation for each step. You can leave v or h out; but t is required.
      • h means the lines will be horizontally flipped
      • v means the lines will be vertically flipped
      • t should always be included, otherwise you won’t see any repetition
    • horizReflect=0 will disable the second row of the frieze, which is a horizontal reflection. Setting it =1 will turn reflection back on.
    • strokeWeight=#.# allows you to control the pixel weight of the lines; values between 0.5 and 4 are the general range you want to be in.

References:

  • 100 Essential Things You didn’t know you didn’t know about Math & the Arts - Chapter 30: “Strip Friezes”
  • YouTube: The Mathematics of Friezes - Crystal clear explanation of Friezes.

Links:

  • Live View
  • Source on Github

Screenshots:

screenshot screenshot screenshot screenshot

Screen captures

With Horiztonal Reflection:

screencap

Without Horizontal Reflection::

screencap