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.
2 parents 773eb0d + 7c91654 commit 7587e0aCopy full SHA for 7587e0a
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