Hi,
I’m trying to generate an SVG with bezier curves in it from processing. However, when I open the resulting SVG in illustrator, there are duplicates of every curve – one with no fill but a line, and one with no line, but a fill. I’m using the following settings:
stroke(127,0,0);
strokeWeight(3);
noFill();
and creating the curve with a call to bezier()
Would appreciate help with this! Thanks
jen
Yes, the lines are still duplicated.
Here is a simple demo that has this bug:
import processing.svg.PGraphicsSVG;
PGraphics offscreenBuffer;
//===================================================
void setup() {
size(600,900);
offscreenBuffer = createGraphics(width, height, SVG, "curveDemo.svg");
offscreenBuffer.beginDraw();
}
//===================================================
void draw() {
stroke(127, 0,0);
strokeWeight(1);
noFill();
line(30,30,50,30);
bezier(10, 20, 10, 10, 20, 20, 30, 30);
offscreenBuffer.line(30,30,50,30);
offscreenBuffer.bezier(10, 20, 10, 10, 20, 20, 30, 30);
}
//===================================================
void keyPressed() {
switch (key) {
case 's':
case 'S': // S to save
offscreenBuffer.dispose();
offscreenBuffer.endDraw();
offscreenBuffer = createGraphics(width, height, SVG, "curveDemo.svg");
break;
}
}
But when I change the code to create the buffer inside draw() things seem to work fine:
//===================================================
void draw() {
stroke(127, 0,0);
strokeWeight(1);
noFill();
line(30,30,50,30);
bezier(10, 20, 10, 10, 20, 20, 30, 30);
offscreenBuffer = createGraphics(width, height, SVG, "curveDemo.svg");
offscreenBuffer.beginDraw();
offscreenBuffer.strokeWeight(1);
offscreenBuffer.noFill();
offscreenBuffer.stroke(127,0,0);
offscreenBuffer.line(30,30,50,30);
offscreenBuffer.bezier(10, 20, 10, 10, 20, 20, 30, 30);
}