I’ve been working on this for god knows how long, but I’m just not that sure how to make this better. Thoughts or comments? I couldn’t figure out how to make the lines not touch each other, so it constantly looks so messy.
it’s also really long for no reason
import processing.pdf.*;
void setup() {
//background setup
size (900, 900);
background(128,128,118);
beginRecord(PDF, "##.pdf");
do_work();
endRecord();
}
void draw() {}
void do_work() {
// clear & prepare canvas
background(128,128,118);
//the final boundary wall
beginShape();
noFill();
vertex(60,5);
vertex(890,25);
vertex(890,850);
vertex(780,890);
vertex(60,890);
vertex(10,890);
vertex(5,750);
endShape(CLOSE);
//starting angle point of main lines
stroke(0);
strokeWeight(1);
myLine( 32 );
myLine( 64 );
myLine( 96 );
myLine( 132 );
myLine( 164 );
myLine( 196 );
myLine( 228 );
myLine( 264 );
myLine( 296 );
myLine( 320 );
myLine( 352 );
myLine2( 48 );
myLine2( 80 );
myLine2( 112 );
myLine2( 144 );
myLine2( 176 );
myLine2( 208 );
myLine2( 240 );
myLine2( 272 );
myLine2( 304 );
myLine2( 336 );
myLine2( 368 );
noLoop();
}
void myLine(float angle) {
float angle2=radians(angle);
float xCenter=cos(angle2) * 20 + width/2;
float yCenter=sin(angle2) * 20 + height/2;
float r1 = random(10, 300);
float x=cos(angle2) * r1 + xCenter;
float y=sin(angle2) * r1 + yCenter;
//main lines coming from the middle
line(xCenter, yCenter, x, y);
pushMatrix();
translate(x, y);
float angle3 = give90orminus90();
rotate(radians(angle+angle3));
float r2=random(75, 100);
line(0, 0, 40, 0);
translate(40, 0);
rotate(radians(-angle3));
line(0, 0, 80, 0);
translate(80, 0);
rotate(radians(give90orminus90() ));
line(0, 0, 150, 0);
translate(150, 0);
rotate(radians(-angle3));
line(0, 0, (random(100)), 0);
translate(100, 0);
rotate(radians(-angle3));
line(0, 0, (random(40, 100)), 0);
//lines spourting out
for (int aa = 0; aa<1; aa = aa + 11) {
translate(10,0);
rotate(radians(give90orminus90() ));
line(0, 0, 10, 0);
translate(10,0);
rotate(radians(-angle3));
line(0, 0,40, 0);
}
for (int a = 0; a<1; a = a + 11) {
translate(40,0);
rotate(radians(give90orminus90() ));
line(0, 0, 10, 0);
translate(10,0);
rotate(radians(-angle3));
line(0, 0,40, 0);
for (int b = 0; b<1; b = b + 11) {
translate(5,0);
rotate(radians(give90orminus90() ));
line(0, 0, 150, 0);
translate(150,0);
rotate(radians(-angle3));
line(0, 0,50, 0);
translate(50,0);
rotate(radians(-angle3));
line(0, 0,20, 0);
}
}
for (int aa = 0; aa<1; aa = aa + 11) {
translate(20,0);
rotate(radians(give90orminus90() ));
line(0, 0, 10, 0);
translate(10,0);
rotate(radians(-angle3));
line(0, 0,40, 0);
for (int bb = 0; bb<1; bb = bb + 11) {
translate(5,0);
rotate(radians(give90orminus90() ));
line(0, 0, 150, 0);
translate(150,0);
rotate(radians(-angle3));
line(0, 0,50, 0);
translate(50,0);
rotate(radians(-angle3));
line(0, 0,20, 0);
}
for (int aaa = 0; aaa<1; aaa = aaa + 11) {
translate(20,0);
rotate(radians(give90orminus90() ));
line(0, 0, 10, 0);
translate(10,0);
rotate(radians(-angle3));
line(0, 0,40, 0);
for (int bbb = 0; bbb<1; bbb = bbb + 11) {
translate(5,0);
rotate(radians(give90orminus90() ));
line(0, 0, 200, 0);
translate(150,0);
rotate(radians(-angle3));
line(0, 0,50, 0);
translate(50,0);
rotate(radians(-angle3));
line(0, 0,20, 0);
}
}
}
popMatrix();
}
void myLine2(float angle2) {
float angle22=radians(angle2);
float xCenter2=cos(angle22) * 100 + width/2;
float yCenter2=sin(angle22) * 100 + height/2;
float r12 = random(10, 300);
float x2=cos(angle22) * r12 + xCenter2;
float y2=sin(angle22) * r12 + yCenter2;
//main lines coming from the middle
line(xCenter2, yCenter2, x2, y2);
pushMatrix();
translate(x2, y2);
float angle32 = give90orminus90();
rotate(radians(angle2+angle32));
float r22=random(75, 100);
line(0, 0, 40, 0);
translate(40, 0);
rotate(radians(-angle32));
line(0, 0, 80, 0);
translate(80, 0);
rotate(radians(give90orminus90() ));
line(0, 0, 150, 0);
translate(150, 0);
rotate(radians(-angle32));
line(0, 0, (random(100)), 0);
translate(100, 0);
rotate(radians(-angle32));
line(0, 0, (random(40, 100)), 0);
//lines spourting out
for (int aa2 = 0; aa2<1; aa2 = aa2 + 11) {
translate(10,0);
rotate(radians(give90orminus90() ));
line(0, 0, 10, 0);
translate(10,0);
rotate(radians(-angle32));
line(0, 0,40, 0);
}
for (int a2 = 0; a2<1; a2 = a2 + 11) {
translate(40,0);
rotate(radians(give90orminus90() ));
line(0, 0, 10, 0);
translate(10,0);
rotate(radians(-angle32));
line(0, 0,40, 0);
for (int b2 = 0; b2<1; b2 = b2 + 11) {
translate(5,0);
rotate(radians(give90orminus90() ));
line(0, 0, 150, 0);
translate(150,0);
rotate(radians(-angle32));
line(0, 0,50, 0);
translate(50,0);
rotate(radians(-angle32));
line(0, 0,20, 0);
}
}
for (int aa2 = 0; aa2<1; aa2 = aa2 + 11) {
translate(20,0);
rotate(radians(give90orminus90() ));
line(0, 0, 10, 0);
translate(10,0);
rotate(radians(-angle32));
line(0, 0,40, 0);
for (int bb2 = 0; bb2<1; bb2 = bb2 + 11) {
translate(5,0);
rotate(radians(give90orminus90() ));
line(0, 0, 150, 0);
translate(150,0);
rotate(radians(-angle32));
line(0, 0,50, 0);
translate(50,0);
rotate(radians(-angle32));
line(0, 0,20, 0);
}
}
popMatrix();
}
float give90orminus90() {
if (random(100)<50)
return random(60,100);
else return random(-60,-100);
}