xxxxxxxxxx
let w = 60;
let h = 60;
let g = 90;
function setup() {
createCanvas(559, 397, SVG);
background(255);
rectMode(CENTER);
}
function draw() {
//background(255);
clear();
//g = map (mouseX, 0, width, 25, 200);
translate(30, 47);
for (let y = 0; y < 5; y++) {
for (let x = 0; x < 9; x++) {
push();
let a = map(x, 0, 8, 0.2, 1);
let a1 = map(y, 0, 4, 0, 0.5*PI);// calculate angle
let b = map(x, 0, 21, 0, 50*PI);
let c = map(y, 0, 4, HALF_PI, PI);
let r = map(y, 0, 4, 0, -QUARTER_PI);
let d = map(x, 0, 8, 45, 60)
translate(x * d, y * 75); // translate by xy position plus gridsize g
//rotate(a1);
rotate(QUARTER_PI);
noFill();
stroke(0);
//strokeWeight(2);
scale(a);
rotate(r);
arc(0, 0, w, h, 0, c, PIE);
rotate(PI);
arc(0, 0, w, h, 0, c, PIE);
//rect(0, 0, w, h); // set rect with width height
pop();
}
}
/*
rect(125, height/2, w, h);
rect(200, height/2, w, h);
rect(275, height/2, w, h);
rect(350, height/2, w, h);
rect(425, height/2, w, h);
rect(500, height/2, w, h);
rect(575, height/2, w, h);
rect(650, height/2, w, h);
rect(725, height/2, w, h);
rect(800, height/2, w, h);
*/
}
function mousePressed() {
save("mySVG.svg");
}