# Displaying PShapes

**URL:** <https://discourse.processing.org/t/displaying-pshapes/7686>\
**Category:** Coding Questions\
**Created:** [January 21, 2019, 12:15am UTC](https://discourse.processing.org/t/displaying-pshapes/7686 "2019-01-21T00:15:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![stirman](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/stirman/32/1321_2.png) [@stirman](https://discourse.processing.org/u/stirman)\
**Post date:** [January 21, 2019, 12:15am UTC](https://discourse.processing.org/t/displaying-pshapes/7686/1 "2019-01-21T00:15:22Z")

</div>

As part of my larger [Scribble Portrait series](https://stirman.net), I’m trying to make all the scribbles shapes that I can add as children to a parent shape, to manipulate them all together after they’ve been drawn. I’m having trouble getting shapes created with createShape() to render.

The following code doesn’t draw anything… am I missing or misusing something here?

```auto
PShape curve;

void setup() {
  size(600, 600, P3D);
  background(255);
  stroke(0);
  strokeWeight(1);
}

void draw() {
   curve = createShape();
   curve.setStroke(0);
   curve.beginShape();
   for(int i=0; i<20; i++) {
     curve.curveVertex(random(width),random(height),random(100));
   }
   curve.endShape();
   shape(curve);
}

```

---

<div class="post-metadata">

**Author:** ![Kevin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kevin/32/2297_2.png) [@Kevin](https://discourse.processing.org/u/Kevin)\
**Post date:** [January 21, 2019, 1:23am UTC](https://discourse.processing.org/t/displaying-pshapes/7686/2 "2019-01-21T01:23:31Z")

</div>

Your shape is drawing. The problem is that it’s drawing white shapes on a white background, so you can’t see it.

Try changing your background color to red, and your frame rate to 1 to see what I mean.

```auto
  background(255, 0, 0);
  frameRate(1);

```

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/7/73cd1bf18319503fd737bb5b0bf53bd30f1abe5e.png)

You can fix this by setting the fill and stroke of the shape:

```auto
   curve.beginShape();
   curve.noFill();
   curve.stroke(0);

```

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/0/0318cd7a994654228a47be00cacf9172bf52f29c.png)

PS: Your scribble project is pretty cool! I’d be curious to hear more about your experience selling on the internet sometime.

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [January 21, 2019, 1:23am UTC](https://discourse.processing.org/t/displaying-pshapes/7686/3 "2019-01-21T01:23:36Z")

</div>

basically, if it would work you would create 60 different shapes per second…

sorry, i changed too much, but to give you a idea  
about the sketch structure i would use:

```auto
PShape curve;

void setup() {
  size(200, 200,P3D);
  make_curve();
}

void make_curve() {
  curve = createShape();
  curve.beginShape();
  for (int i=0; i<20; i++)
            curve.curveVertex(random(width), random(height),0);
  curve.endShape();  
  curve.setStroke(color(200, 0, 0));
  curve.setFill(color(0,200,0));
}

void draw() {
  background(200,200,0);
  shape(curve,0,0);
}

void mousePressed() {
 make_curve(); 
}

```

---

<div class="post-metadata">

**Author:** ![stirman](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/stirman/32/1321_2.png) [@stirman](https://discourse.processing.org/u/stirman)\
**Post date:** [January 21, 2019, 2:18am UTC](https://discourse.processing.org/t/displaying-pshapes/7686/4 "2019-01-21T02:18:47Z")

</div>

Ahh, word… wasn’t setting the stroke right on the shape, and didn’t realize that a noFill() in setup didn’t apply to the shapes. Thank you!!

Thanks for the kind words. Happy to share more about the little business, hit me up [hello@stirman.net](mailto:hello@stirman.net) 🙂

---

<div class="post-metadata">

**Author:** ![kevout](https://avatars.discourse-cdn.com/v4/letter/k/8edcca/32.png) [@kevout](https://discourse.processing.org/u/kevout)\
**Post date:** [July 10, 2020, 12:48pm UTC](https://discourse.processing.org/t/displaying-pshapes/7686/5 "2020-07-10T12:48:42Z")

</div>

hay alguna forma de aprender a hacer scribble portraits? es para un pen plotter
