Marco H
YaBB Newbies
Offline
Posts: 8
Portugal
exporting to svg
Feb 3rd , 2007, 12:16am
I'm having problems exporting svg files out of processing 0123 on WinXP. As soon as I run a sample it´s gives me this erro: Exception in thread "Thread-2" java.lang.NoClassDefFoundError: processing/core/PGraphics2 at java.lang.ClassLoader.defineClass1(Native Method) I not a professional programar and I´m new to processing. Can you help me? This is the sample code that i´m trying: import prosvg.*; flower one; void setup(){ size(1000,200,"prosvg.SVGOut"); strokeCap(ROUND); stroke(255,100); smooth(); background(255); one = new flower(random(width),random(height)); } int counter = 0; void draw(){ background(255); for(int i = 0;i < 100;i++){ float actualX = random(width); float actualY = random(height); one = new flower(actualX,actualY); fill(random(155,255),0,random(155,255),random(50,150)); one.paint(); strokeWeight(1.0); } saveFrame("testFlowers-####.svg"); saveFrame("testFlowers-####.tif"); if(counter >= 10)noLoop(); counter++; } class Point{ float xPos; float yPos; Point(float xPos,float yPos){ this.xPos = xPos; this.yPos = yPos; } } class flower{ float[][] rands; int repeats; float basic_rnd01; float basic_rnd02; float basic_rnd03; float basic_rnd04; float basic_rnd05; float xPos,yPos; flower(float xPos,float yPos){ repeats = int(random(10,30)); rands = new float[repeats][22]; basic_rnd01 = random(0,10); basic_rnd02 = basic_rnd01 + random(0,10); basic_rnd03 = basic_rnd02 + random(30); basic_rnd04 = basic_rnd03 + random(20); basic_rnd05 = basic_rnd04 + random(40); setRands(); this.xPos = xPos; this.yPos = yPos; } void setRands(){ for(int i = 0; i < repeats;i++){ rands[i][0] = random(basic_rnd01,basic_rnd02); rands[i][1] = random(basic_rnd01,basic_rnd02); rands[i][2] = random(basic_rnd01,basic_rnd02); rands[i][3] = random(basic_rnd01,basic_rnd02); rands[i][4] = random(basic_rnd02,basic_rnd03); rands[i][5] = random(basic_rnd02,basic_rnd03); rands[i][6] = random(basic_rnd01,basic_rnd02); rands[i][7] = random(basic_rnd04,basic_rnd05); rands[i][8] = random(basic_rnd02,basic_rnd03); rands[i][9] = random(basic_rnd02,basic_rnd03); rands[i][10] = random(basic_rnd01,basic_rnd02); rands[i][11] = random(basic_rnd04,basic_rnd05); rands[i][12] = random(basic_rnd02,-basic_rnd03); rands[i][13] = random(basic_rnd02,-basic_rnd03); rands[i][14] = random(basic_rnd01,basic_rnd02); rands[i][15] = random(basic_rnd04,basic_rnd05); rands[i][16] = random(basic_rnd02,-basic_rnd03); rands[i][17] = random(basic_rnd02,-basic_rnd03); rands[i][18] = random(basic_rnd01,-basic_rnd02); rands[i][19] = random(basic_rnd01,-basic_rnd02); rands[i][20] = random(basic_rnd01,-basic_rnd02); rands[i][21] = random(basic_rnd01,-basic_rnd02); } } void paint(){ pushMatrix(); translate(xPos,yPos); for(int i = 0; i < repeats;i++){ rotate(TWO_PI/repeats); beginShape(POLYGON); vertex(0, 0); vertex(rands[i][0], rands[i][1]); bezierVertex( rands[i][2], rands[i][3], rands[i][4], rands[i][5], rands[i][6], rands[i][7] ); bezierVertex( rands[i][8], rands[i][9], rands[i][10], rands[i][11], rands[i][12], rands[i][13] ); bezierVertex( rands[i][14], rands[i][15], rands[i][16], rands[i][17], rands[i][18], rands[i][19] ); vertex(rands[i][20], rands[i][21]); endShape(); } popMatrix(); } }