// callipen // An effort to code something like Kalliculator (Frederik Berlaen // generate an outline from a single stroke float w; // width of the int res; // amount of bezierPoints (=resolution) float s; // size of ellipse to mark bezierPoints float angle;// = random(HALF_PI); //PI; int cnt; // counter for the bezier-array float step = 0.008; // Size of each step along the path float pct = 0.00; // Percentage traveled (0.0 to 1.0) float[] gDist = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0}; float[] gBegin = { 20,20,30,20,80,60,40,110,10,60,50,20,60,20}; float[] gCur = { 20,20,30,20,80,60,40,110,10,60,50,20,60,20}; float[] gEnd = { 20,20,30,20,80,60,40,110,10,60,50,20,60,20}; PFont font; char[] geTikt = new char[0]; void setup() { size(400, 400); noFill(); smooth(); for (cnt=0;cnt<14;cnt++){ gDist[cnt] = gEnd[cnt] - gBegin[cnt]; } } void draw(){ if (pct >=1.00) { noLoop(); } else { loop(); } //draw a black rect to make transformation look smooth fill(0,30); noStroke(); rect(0,0,width,height); noFill(); pct += step; if (pct < 1.00) { for (cnt=0;cnt<14;cnt++){ gCur[cnt] = gBegin[cnt] + (pct * gDist[cnt]); } pushMatrix(); translate (150,120); drawBezier(); popMatrix(); } }