Hi,
I am cosidering myself still a beginner, trying to learn as much as I can.
I would like to realize something but I m stuck. maybe someone has a tip or solution…
Within my sketch I create little circles row by row. they all have the same diameter and distance to each other and a given starting point.
And I have loaded an .svg shape.
What I would like to achieve is, that that circles start inside this shape (top left corner) fill the first row and when it reaches the right boarder of the shape jumps into the next row, starting there in a way that it is always inside the shape… I wouldn t mind, if the circles arent vertically aligned due to different starting points
Do you know what I mean ?
Any help welcome.
cheers, Tom!
import processing.pdf.*;
PShape s;
float x;
float y;
float xsp = 20;
void setup () {
size (600, 600);
s = loadShape("test.svg");
beginRecord(PDF, "test.pdf");
background(255);
smooth();
noStroke();
fill(0,250);
frameRate(5);
x = 20;
y = 20;
}
void draw () {
shape(s, 0, 0, 500, 500);
x = x + xsp;
ellipse (x, y, 8, 8);
fill (0,255);
if (x > width-40) {
x = 20;
y += 15;
}
}
void keyPressed() {
if (key == 's') {
endRecord();
exit();
}
}