# Line Drawings with p5.Geometry

**URL:** https://discourse.processing.org/t/line-drawings-with-p5-geometry/30953
**Category:** Coding Questions
**Created:** [June 28, 2021, 9:01pm UTC](https://discourse.processing.org/t/line-drawings-with-p5-geometry/30953 "2021-06-28T21:01:03Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![hardwhere](https://avatars.discourse-cdn.com/v4/letter/h/ce73a5/32.png) [@hardwhere](https://discourse.processing.org/u/hardwhere)
#### Post date: [June 28, 2021, 9:01pm UTC](https://discourse.processing.org/t/line-drawings-with-p5-geometry/30953/1 "2021-06-28T21:01:03Z")

</div>

Hello! I was recently able to get help on a question with p5.Geometry ([here](https://discourse.processing.org/t/drawing-and-orbiting-a-shape-with-many-vertices/30375)) and am back with another question:

Is it possible to use p5.Geometry to make a line drawing? In immediate mode, we can pass a parameter to `beginShape()` (e.g. POINTS, LINES, TRIANGLES, TRIANGLE\_FAN, etc). I see that [the drawBuffers function](https://github.com/processing/p5.js/blob/2ed5488b0e4f25e4a2420862c79067cfa9ae4d94/src/webgl/p5.RendererGL.Retained.js#L127) uses webGL’s `TRIANGLES` mode; is there a way to instead use `LINE_STRIP`?

I’m new to webGL so let me know if this doesn’t make sense, or there some better way to accomplish a line drawing like this! Thanks!

---

<div class="post-metadata">

### Author: ![KumuPaul](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kumupaul/32/13072_2.png) [@KumuPaul](https://discourse.processing.org/u/KumuPaul)
#### Post date: [June 29, 2021, 9:06am UTC](https://discourse.processing.org/t/line-drawings-with-p5-geometry/30953/2 "2021-06-29T09:06:30Z")

</div>

p5.js doesn’t expose any easy way to use WebGLs other drawing modes with p5.Geometry. However, have you tried just calling `noFill()` and `stroke(...)` with the color of lines that you want? I think the main difference between this and the LINES drawing mode will be the thickness of the lines (with WebGL LINES, they’ll be uniform thickness regardless of distance, with p5.js and stroke() the closer the line is to the camera the thicker the lines will be).

---

<div class="post-metadata">

### Author: ![hardwhere](https://avatars.discourse-cdn.com/v4/letter/h/ce73a5/32.png) [@hardwhere](https://discourse.processing.org/u/hardwhere)
#### Post date: [July 27, 2021, 3:59pm UTC](https://discourse.processing.org/t/line-drawings-with-p5-geometry/30953/3 "2021-07-27T15:59:54Z")

</div>

Just came back to this and saw my reply didn’t post!

Thanks for the insights @KumuPaul - I thought I had tried this but must have done it wrong, because it works! Good to learn that p5 doesn’t expose ways to use other drawing modes
