Kimberlyn Cho- Project 04

string

/* Kimberlyn Cho
Section C
ycho2@andrew.cmu.edu
Project 4 */

//all comments in context of left to right

function setup () {
	createCanvas(400, 300);
	background(255);
	strokeWeight(0.03);
}

function draw () {
	for (var i = 0; i < 30; i++) {
		var a = i * 5
		var b = i * 7
		b = constrain(b, 0, width / 2);

		//bottomleft fold
		stroke(0);
		line(0, b + height / 2, b, height);

		//middle gray fold 
		stroke(105);
		line(0, a, b, height / 2);
		stroke(0);
		line(b, height / 2, width / 2, height / 2 + b);
		stroke(105);
		line(width / 2, height / 2 + a, b + width / 2, height);

		//middle red fold
		stroke(160,0,0);
		line(0, a / 2, b / 2, height / 4);
		stroke(72,0,0);
		line(a - width / 9, height / 4, width / 4, a + height / 4);
		stroke(160,0,0);
		line(width / 4, a + height * 0.26, b + width / 4, height * 0.75);
		stroke(72,0,0);
		line(b + width / 4, height * 0.75, width * 0.75, height * 0.75 + b);
		stroke(160,0,0);
		line(width * 0.75, height * 0.75 + b, width * 0.75 + b, height);

		//outer right
		stroke(0);
		line(width, b * 1.5, b * 2, 0);

		//middletop
		stroke(0, 0, 204);
		line(b, 0, width / 2, b);
		line(b + width / 2, 0, width / 2, height / 2 - b);
		
		//pins
		fill(0);
		ellipse(0, 0, 20, 20)
		ellipse(0, height / 4, 10, 10)
		ellipse(width / 4, height / 4, 10, 10)
		ellipse(width / 4, height * 0.75, 10, 10)
		ellipse(width * 0.75, height * 0.75, 10, 10)
		ellipse(width * 0.75, height, 10, 10)
		ellipse(width, height, 20, 20)
		ellipse(0, height / 2, 10, 10)
		ellipse(width / 2, height / 2, 10, 10)
		ellipse(width / 2, height, 10, 10)
		ellipse(width, 0, 20, 20)
		ellipse(0, height, 20, 20)

	};
}

I was inspired by tensile systems such as pinning down flexible materials such as nylon. I used different shades to emphasize the folding pattern of the middles pieces.

Leave a Reply