String Art?

sketch
//Emily Brunner, ebrunner
//Section C

function setup() {
    createCanvas(400, 300);
    background(200);

}

function draw() {
background(200);
for(i = 0; i <= width; i += 10){                 //DARK RED LINES
    stroke("darkred");
    line(width/2 - width, height/2, i, 0);
    line(width/2 - width, height/2, i, height);
}
for(i = 0; i <= width; i += 10){
    stroke("darkred");
    line(width/2 + width, height/2, i, 0);
    line(width/2 + width, height/2, i, height);
}
for(i = 0; i <= width; i += 10){
    stroke("darkred");
    line(width/2 + width/2, height/2, i, 0);
    line(width/2 + width/2, height/2, i, height);
}
for(i = 0; i <= width; i += 10){
    stroke("darkred");
    line(width/2 - width/2, height/2, i, 0);
    line(width/2 - width/2, height/2, i, height);
}
for(i = 0; i <= width; i += 10){
    stroke("darkred");
    line(width/2 + width/3, height/2, i, 0);
    line(width/2 + width/3, height/2, i, height);
}for(i = 0; i <= width; i += 10){
    stroke("darkred");
    line(width/2 - width/3, height/2, i, 0);
    line(width/2 - width/3, height/2, i, height);
}
for(i = 0; i <= width; i += 10){
    stroke("darkred");
    line(width/2 + width/4, height/2, i, 0);
    line(width/2 + width/4, height/2, i, height);
}for(i = 0; i <= width; i += 10){
    stroke("darkred");
    line(width/2 - width/4, height/2, i, 0);
    line(width/2 - width/4, height/2, i, height);
}



for(i = 0; i <= width; i += 10){         //YELLOW LINES
    stroke(246, 190, 0);
    line(width/5, height/2, i, 0);
    line(width/5, height/2, i, height);
}
for(i = 0; i <= width; i += 10){
    stroke(246, 190, 0);
    line(width/3 + width/2, height/2, i, 0);
    line(width/3 + width/2, height/2, i, height);
}


for(i = 0; i <= height; i += 10){             //ORANGE LINES
    stroke("orange");
    line(width/5, height/2, 0, i);
    line(width/5, height/2, width, i);
}
for(i = 0; i <= width; i += 10){
    stroke("darkorange");
    line(width/3 + width/2, height/2, 0, i);
    line(width/3 + width/2, height/2, width, i);
}
}

I had trouble with the math of this project, and understanding how to get the lines to do what I wanted. I didn’t get to draw a picture that was similar to what I pictured or found on the internet, but I made something that visually looks appealing so I call that a win.

Leave a Reply