xxxxxxxxxx
let decay = 0.69
let scl = 1.39
function drawing(x, y, r, offset) {
push()
translate(x, y)
let r2 = r * decay
stroke(51)
let vertices = []
beginShape()
for (let a = 0.0; a < TAU - 0.00001; a += TAU / 4) {
let x = r * cos(a + offset)
let y = -r * sin(a + offset)
vertices.push([x, y])
vertex(x, y)
if (r2 > 10) {
drawing(x, y, r2, offset)
}
}
endShape(CLOSE)
beginShape()
for (const vex of vertices) {
vertex(vex[0], vex[1])
}
endShape(CLOSE)
pop()
}
function setup() {
createCanvas(windowWidth, windowHeight);
background(255)
scale(scl)
strokeWeight(1.5 / scl)
let origin = createVector(width / 2 / scl, height / 2 / scl)
drawing(origin.x, origin.y, 100, PI / 2)
drawing(origin.x, origin.y, 90, PI / 5)
drawing(origin.x, origin.y, 90, PI / 6)
}