// Draws to Processing and Postscript simultaneously // by replacing calls to fill(), line() etc. by // custom functions that carry out operations in both. boolean fileOpen=false; SimplePostscript ps; int filenum=0; //storyabout@empal.com int vine_total_ori = 5; int vine_total = vine_total_ori; int vine_max = 1000000; vine [] vine_array = new vine [vine_max]; void setup(){ size(500,500); background(0); vine_gen_ori(); String filename="curl_and_ps_" +filenum +".ps"; print(filename +"\n"); ps=SimplePostscript.open(filename, 0,0, width,height); filenum++; } void loop(){ for(int i=0;i1 && !mousePressed){ vine_array[i].grow(); } } } void mousePressed(){ ps.close(); fileOpen=false; background(0); String filename="curl_and_ps_" +filenum +".ps"; print(filename +"\n"); ps=SimplePostscript.open(filename, 0,0, width,height); filenum++; fileOpen=true; vine_total = vine_total_ori; } void mouseReleased(){ vine_gen_ori(); } void vine_gen_ori(){ for(int i=0;i