Project 05: Wallpaper

sketch

I thought this project was pretty fun! I approached it almost like making a singular tile and then repeating that to create the pattern.

//Jacky Lococo
//jlococo
//section C
function setup() {
    createCanvas(500, 500);
    background(220);
    rectMode(CENTER) 
}

function draw() {
    for(var y = 125/4; y <= height-25; y += 62.5){  //columns made from tile function
        for (var x = 125/4; x <= width-25; x += 62.5){ //rows for tile fuction
        tile (x, y)
    } 
    }

}

function tile (x,y){
    push();
    translate(x,y)

    //main square for the tile -- contains quarter arcs that will make a semi cirlce when repeated
    strokeWeight(0)
    fill(255, 247, 243)
    rect(x, y, 125, 125)

    //black circle within the horizontal cirlce
    strokeWeight(0)
    fill(0)
    ellipse(x+25, y+10, 23, 23)

    //horizontal arc
    strokeWeight(0);
    fill(242, 0, 0)
    arc(x+25, y+10, 75, 75, 0, PI+ TWO_PI, CHORD)


    //3 lines coming from the horizontal arc
    strokeWeight(1)
    line(x + 25, y+10, x-25, y-62.5)
    line(x - 12.5, y+10, x-61, y-62.5)
    line(x + 5, y+10, x -43, y-62.5)

    //bottom left quarter arc to make verticle arc
    strokeWeight(0);
    fill(242, 0, 0)
    arc(x-24, y+62.5, 75, 75, PI, PI*3/2, PIE)

    //top left quarter arc to make verticle arc
    strokeWeight(0);
    fill(242, 0, 0)
    arc(x-24, y-62.5, 75, 75, PI/2, PI, PIE)

    //single left to right line
    strokeWeight(1)
    line(x-24, y+50, x+62.5, y-62.5)

    //small black arc in the middle of the verticle arc -- only shown half of ellipse 
    strokeWeight(0)
    fill(0)
    ellipse(x-24, y+62.5, 25, 25)

    //tan colored arc at the top right of the tile
    strokeWeight(0);
    fill(255, 247, 243)
    arc(x-24, y-62.5, 25, 25, PI/2, PI, PIE)

    //two small dots on top of each other -- sitting below horizontal arc
    strokeWeight(0);
    fill(0)
    ellipse(x+25, y+55, 5, 5)
    strokeWeight(0);
    fill(0)
    ellipse(x+25, y-55, 5, 5)

    pop()
}


Leave a Reply