SVG from P3D: how to preserve curve continuity and vertex position?

Hi!

I am trying to make 3D curves with curveVertex and export it as an svg file.

However, when I open the resulting svg file with Illustrator, the lines appear correctly, but they are built with unconnected curves, each defined by 2 equally spaced points.

Is there a way to simply project my 3D geometry in a 2D svg file and preserving curve continuity and vertex position?

Here is a simple code that replicates the problem:

import processing.svg.*;
size(1200, 800, P3D);

beginRaw(SVG, "export.svg"); 
  
background(255);
stroke(0);
noFill();

beginShape();
for (int y = -100; y < 100 ; y+=5) {
    curveVertex(width/2 + y,10*sin(y)+height/2,0);
}

endShape();
endRaw();

Any help would be much appreciated!

Thanks in advance,

Vivien

Hi,

Welcome to the forum! :wink:

Exporting SVG from Processing seems rather limited, you might want to read those previous threads :

https://processing.org/discourse/beta/num_1256232505.html

Thank you very much! I will try the ideas mentioned in those threads!

1 Like