Skip to content

Instantly share code, notes, and snippets.

@mwunsch
Created February 9, 2016 20:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mwunsch/0037c60d162783983091 to your computer and use it in GitHub Desktop.
Save mwunsch/0037c60d162783983091 to your computer and use it in GitHub Desktop.
void setup() {
size(1080, 1080);
noStroke();
background(0, 0, 255);
int rows = int(pow(2, int(random(1,6))));
int u = height / (rows + 4);
int thickness = int(pow(2, int(random(1, 4))));
int uth1 = u / thickness;
int uth2 = u + uth1;
int startX = int(-u * 0.75);
int startY = height/2 - rows/2 * u;
int endX = width+u;
int endY = height/2 + rows/2 * u;
for (int x = startX; x < endX; x += u) {
for (int y = startY; y < endY; y += u) {
if (random(1) > 0.5) {
fill(255);
quad(x, y, x+u, y+u, x+uth2, y+u, x+uth1, y);
} else {
fill(0);
quad(x, y+u, x+u, y, x+uth2, y, x+uth1, y+u);
}
}
}
save("10print-rem-variation1.tif");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment