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

**URL:** <https://discourse.processing.org/t/svg-from-p3d-how-to-preserve-curve-continuity-and-vertex-position/28575>\
**Category:** Libraries\
**Created:** [March 16, 2021, 1:18pm UTC](https://discourse.processing.org/t/svg-from-p3d-how-to-preserve-curve-continuity-and-vertex-position/28575 "2021-03-16T13:18:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![YcarusDiedForUs](https://avatars.discourse-cdn.com/v4/letter/y/f4b2a3/32.png) [@YcarusDiedForUs](https://discourse.processing.org/u/YcarusDiedForUs)\
**Post date:** [March 16, 2021, 1:18pm UTC](https://discourse.processing.org/t/svg-from-p3d-how-to-preserve-curve-continuity-and-vertex-position/28575/1 "2021-03-16T13:18:31Z")

</div>

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:

```auto
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

---

<div class="post-metadata">

**Author:** ![josephh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/josephh/32/210_2.png) [@josephh](https://discourse.processing.org/u/josephh)\
**Post date:** [March 16, 2021, 5:52pm UTC](https://discourse.processing.org/t/svg-from-p3d-how-to-preserve-curve-continuity-and-vertex-position/28575/2 "2021-03-16T17:52:03Z")

</div>

Hi,

Welcome to the forum! 😉

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

> **[Export svg? - Processing Forum](https://forum.processing.org/one/topic/export-svg.html)**
>
> Processing Forum

> [@Problem with Bezier Curves when exporting SVG from illustrator,](https://discourse.processing.org/t/problem-with-bezier-curves-when-exporting-svg-from-illustrator/15232):
>
> hi all, I came across this little problem: when exporting a bezier curve as svg from illustrator and then importing it to processing, the control points are considered as vertices, does anyone know how to access anchor points and control points separately? is there any trick to get a good export from illustrator or any way to clean the svg before using it in processing? curve in illustrator: result in processing: [jpg] PShape SVG1; void setup() { smooth(8); size(400, 500); be…

[https://processing.org/discourse/beta/num\_1256232505.html](https://processing.org/discourse/beta/num_1256232505.html)

---

<div class="post-metadata">

**Author:** ![YcarusDiedForUs](https://avatars.discourse-cdn.com/v4/letter/y/f4b2a3/32.png) [@YcarusDiedForUs](https://discourse.processing.org/u/YcarusDiedForUs)\
**Post date:** [March 18, 2021, 10:35am UTC](https://discourse.processing.org/t/svg-from-p3d-how-to-preserve-curve-continuity-and-vertex-position/28575/3 "2021-03-18T10:35:59Z")

</div>

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