# Sketch runs slow in P5.js WEBGL, (SOLVED by using P5.Geometry)

**URL:** https://discourse.processing.org/t/sketch-runs-slow-in-p5-js-webgl-solved-by-using-p5-geometry/31990
**Category:** Coding Questions
**Created:** [August 29, 2021, 2:33am UTC](https://discourse.processing.org/t/sketch-runs-slow-in-p5-js-webgl-solved-by-using-p5-geometry/31990 "2021-08-29T02:33:50Z")
**Posts on this page:** 1
**Showing post:** 22

<div class="post-metadata">

### Author: ![J\_Silva](https://avatars.discourse-cdn.com/v4/letter/j/3d9bf3/32.png) [@J\_Silva](https://discourse.processing.org/u/J_Silva)
#### Post date: [September 24, 2021, 8:40am UTC](https://discourse.processing.org/t/sketch-runs-slow-in-p5-js-webgl-solved-by-using-p5-geometry/31990/22 "2021-09-24T08:40:32Z")

</div>

Thanks, Paul. I knew I had to assign to each gid, but I tried

> this.gid = ‘nut’+str(id++);

instead of

> this.blendMesh.gid = ‘nut’+str(id++);

so that didn’t work. I have been ill for quite some days, but since yesterday I feel better and I decided to design “the enemy”, to look straight in its face. I used .obj files made by drawing vertexes in P5.java exporting them with a really good Processing library called OBJExport. Its not included in Processing’s “Contribution Manager”, but you can download it [here](https://n-e-r-v-o-u-s.com/tools/obj/). I used .obj because I thought that constructing the faces individually as I did with the ‘nut’ sketch would give tremendous work. But now I’ve read your last post, I see there is a method for it in the [p5.Geometry Class](https://github.com/processing/p5.js/blob/main/src/webgl/p5.Geometry.js) to compute them. I should have taken your advice to study this Class sooner. But this will be my next step. Writing the objects of this sketch in p5.Geometry.

https://preview.p5js.org/J_Silva/embed/3Oln0Ofgg

---

_[View the full topic](https://discourse.processing.org/t/sketch-runs-slow-in-p5-js-webgl-solved-by-using-p5-geometry/31990)._
