We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 773eb0d commit 7c91654Copy full SHA for 7c91654
src/webgl/p5.Geometry.js
@@ -291,8 +291,10 @@ p5.Geometry = class Geometry {
291
const vertexIndices = {};
292
const uniqueVertices = [];
293
294
+ const power = Math.pow(10, roundToPrecision);
295
+ const rounded = val => Math.round(val * power) / power;
296
const getKey = vert =>
- `${vert.x.toFixed(roundToPrecision)},${vert.y.toFixed(roundToPrecision)},${vert.z.toFixed(roundToPrecision)}`;
297
+ `${rounded(vert.x)},${rounded(vert.y)},${rounded(vert.z)}`;
298
299
// loop through each vertex and add uniqueVertices
300
for (let i = 0; i < vertices.length; i++) {
0 commit comments