/
georg-nees.js
33 lines (30 loc) · 994 Bytes
/
georg-nees.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { Void } from 'void'
// https://collections.vam.ac.uk/item/O221321/schotter-print-nees-georg/
// http://www.medienkunstnetz.de/works/schotter/
export default function () {
let { width, height } = Void.settings({
dimensions: [4, 7, 'in'],
margin: [0.25, 'in'],
units: 'pt',
})
let ctx = Void.layer()
let cols = Void.int('columns', 4, 16)
let disp = Void.int('displacement', 0, 25)
let rot = Void.int('rotation', 0, 180, 30) * (Math.PI / 180)
let cell = width / cols
let half = cell / 2
for (let x = 0; x < width; x += cell) {
for (let y = 0; y < height - cell; y += cell) {
let t = Math.max(y / height, 0.07) ** 1.5
let angle = t * Void.random(-rot, rot)
let ox = t * Void.random(-disp, disp)
let oy = t * Void.random(-disp, disp)
ctx.save()
ctx.translate(x + ox + half, y + oy + half)
ctx.rotate(angle)
ctx.translate(-half, -half)
ctx.strokeRect(0, 0, cell, cell)
ctx.restore()
}
}
}