# Duplicate Curves

**URL:** <https://discourse.processing.org/t/duplicate-curves/35366>\
**Category:** Coding Questions\
**Created:** [February 21, 2022, 7:56pm UTC](https://discourse.processing.org/t/duplicate-curves/35366 "2022-02-21T19:56:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmankoff](https://avatars.discourse-cdn.com/v4/letter/j/b2d939/32.png) [@jmankoff](https://discourse.processing.org/u/jmankoff)\
**Post date:** [February 21, 2022, 7:56pm UTC](https://discourse.processing.org/t/duplicate-curves/35366/1 "2022-02-21T19:56:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [February 21, 2022, 8:52pm UTC](https://discourse.processing.org/t/duplicate-curves/35366/2 "2022-02-21T20:52:46Z")

</div>

> [@jmankoff](#):
>
> strokeWeight(3);

Did you try 1 instead

---

<div class="post-metadata">

**Author:** ![jmankoff](https://avatars.discourse-cdn.com/v4/letter/j/b2d939/32.png) [@jmankoff](https://discourse.processing.org/u/jmankoff)\
**Post date:** [February 22, 2022, 2:34am UTC](https://discourse.processing.org/t/duplicate-curves/35366/3 "2022-02-22T02:34:41Z")

</div>

Yes, the lines are still duplicated.

---

<div class="post-metadata">

**Author:** ![jmankoff](https://avatars.discourse-cdn.com/v4/letter/j/b2d939/32.png) [@jmankoff](https://discourse.processing.org/u/jmankoff)\
**Post date:** [February 22, 2022, 4:46am UTC](https://discourse.processing.org/t/duplicate-curves/35366/4 "2022-02-22T04:46:21Z")

</div>

Here is a simple demo that has this bug:

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

}
```

---

<div class="post-metadata">

**Author:** ![jmankoff](https://avatars.discourse-cdn.com/v4/letter/j/b2d939/32.png) [@jmankoff](https://discourse.processing.org/u/jmankoff)\
**Post date:** [February 22, 2022, 4:55am UTC](https://discourse.processing.org/t/duplicate-curves/35366/5 "2022-02-22T04:55:55Z")

</div>

But when I change the code to create the buffer inside draw() things seem to work fine:

```auto
//===================================================
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);
}

```
