// CCurveDemoFall2022_010 void setup() { size(1500, 1000, P2D); frameRate(60); colorMode(HSB, 360, 100, 100, 100); background(180, 100, 100); } boolean firsttime = true ; void draw() { background(180, 100, 100); push(); placeShape(width/2, round(3 * height / 4.0), height / 2, height / 128 -1); pop(); if (firsttime) { // saveFrame("CCurve-######.jpg"); firsttime = false ; } } void placeShape(int startx, int starty, int length, int limit) { push(); //<>// translate(startx, starty); recursiveDraw(length, limit); pop(); } void recursiveDraw(int length, int limit) { //<>// push(); if (length < limit) { line(0, 0, 0, -length); //<>// } else { int newlen = round(length / sqrt(2)); rotate(radians(-45)); recursiveDraw(newlen, limit); translate(0, -newlen); rotate(radians(90)); recursiveDraw(newlen, limit); } pop(); }