This was bound to happen…

Yashraje
2 min readSep 14, 2022

--

Just as I had began to inflate my ego this coding stuff was “easy-peasy”(I said “easy-peasy” my first time working with Processing during my undergrad), Processing harshly dragged me back down to reality. So it was an interesting week to sat the least.

My idea for this weeks code was to create flower-like shape and make a grid of it, not unlike similar patterns we seen in clothing, specifically luxury brands like Louis Vuittons or Gucci It started off well, I created function to draw the flower , and my idea was to call a grid function that would repeat the pattern making a larger pattern.However, I got stuck trying to make sure that in creating multiple starting in one function was causing the patterns to get messed up, so needless to say I’m in a pickle. I managed to get on row of the pattern created at the top of the canvas. I’ve added my code below, and would greatly appreciate feedback and help😅:

int spacing = 200;
int scale = 200;
int col, row;
void setup() {
//Canvas size
size(1000, 200);
background(0);
noFill();
col = 5;
row = 5;
}

void draw() {

//create grid
for (int i = 0; i < col; i++) {
for (int j = 0; j < row; j++) {

//add shifting parameters
int shiftX =i*200;
pattern(100, 0, 10, 50, 255);
translate(shiftX, 0);
}
}
}

void pattern( int patternX, int patternY, int numSquares, int squareSize, int strokeColor ) {
for (int i = 0; i < numSquares; i++) {
push();
rotate(TWO_PI/numSquares*i);
stroke(strokeColor);
strokeWeight(0.5);
rect(0, 0, squareSize, 25);
pop();
}
}

--

--