For the past few weeks, I have been exploring p5.js as a prototyping solution for generative artistry. This JavaScript library has a tiny footprint, a clean and declarative API and great documentation.
As a first example, I decided to create a simple abstract vine pattern. Vertices of strokes are randomly created filling the canvas, creating a “noise” texture that looks like unfinished fractals.
javascript·vines.js
const W = 320;
const H = W;
function setup() {
let cnv = createCanvas(H, W);
cnv.parent("cnv");
smooth();
const start = random(10);
let xx = start;
let yy = random(10);
const e = random(0.6);
for (let y = 0; y <= H; y += 5) {
yy += e;
xx = start;
for (let x = 0; x <= W; x += 5) {
xx += e;
push();
translate(x, y);
rotate(noise(xx, yy) * radians(360));
stroke(0, 0, 0);
line(0, 0, 7, 0);
pop();
}
}
}