With the enormous contribution of @carolhmj I have this ConvexHull going on but there are some things going on that i don’t understand. Focus on the buildRenderableMesh() section from line 379- 421.
Probably best have the console open too.
Because the convex-hull I did a this.renderableMesh.forceSharedVertices();
but ended up with way too many faces for the vertices so i tried a this.faces = this.faces.filter(face => face.mark === 0);
in line 385.
faces are marked with a const FaceTypes = { VISIBLE: 0, NON_CONVEX: 1, DELETED: 2, }
in lines 425 - 429
Questions:
- what to do with the newFaces which are also marked as 0 (visible)
- why can’t i set colors to the vertices (mesh turns black)
- what’s going on with the faces/facets? when you run the script a couple of times and rotate the mesh you’ll find it’s sometimes perfect and sometimes you see glitches
Thanks in advance