xxxxxxxxxx
45
// https://alexcodesart.com/create-your-first-digital-artpiece-with-code-a-step-by-step-guide/
// Define spacing and dimensions for the lines and arches
let lineGap = 10;
let archGap = lineGap * 2;
let archRadius = 60;
let lineOffset = archRadius / 2;
let archNumber = 8;
function setup() {
// Create a canvas of 400 by 500 pixels
createCanvas(400, 500);
pixelDensity(3);
}
function draw() {
// Set the background color
background('#e8e0d5');
// Draw the first semicircle (bottom one)
noStroke(); // Remove stroke from the shape
fill('#9F6642'); // Set fill color
arc(width / 2, height / 1.2, width / 2, width / 2, PI, TWO_PI); // Draw the arc
// Draw the second semicircle (top one)
fill('#B39279B3'); // Set fill color with transparency
arc(width / 2, height / 1.7, width / 2, width / 2, 0, PI); // Draw the arc
// Set up the stroke for the arch lines
stroke('#264563'); // Set stroke color
strokeWeight(3); // Set stroke weight
noFill(); // Ensure the arcs are not filled
// Loop to draw multiple lines and arcs to create the arch effect
for (let i = 0; i < archNumber; i++) {
// Draw the left line of the arch
line(width / 2 - (i * lineGap) - lineOffset, height / 1.75, width / 2 - (i * lineGap) - lineOffset, height / 3);
// Draw the right line of the arch
line(width / 2 + (i * lineGap) + lineOffset, height / 1.75, width / 2 + (i * lineGap) + lineOffset, height / 3);
// Draw the arc to connect the lines
arc(width / 2, height / 3, archRadius + i * archGap, archRadius + i * archGap, PI, TWO_PI);
}
}