the implementation follows this - Voxel Game Engine Development: Quadric Mesh Simplification with Source Code , but if you find any way to improve it, i will be more than happy to merge it
I find it weird that it behaves differently locally and online. are ou using es6 or the umd version? is it possible that something doesnt import correctly?
Edit;
Okay, so the small difference in behavior was on my end, running a geometry cleaning function,
Now i’m thinking it isn’t related to the simplification algorithm at all, but minor geometry bugs like empty indices or indices on a strait line, etc
Bumping this…
Something is wrong, i searched and searched but found no bugs in my previously mentioned geometry cleaner.
Thinking simplification algo fails to recognize triangles in some cases…
Here again with a standard cylinder, it refuses to simplify it until you uncomment forceSharedVertices(),
In theory it should also work without ?Babylon.js Playground
Update;
Turns out it was a floating point issue, updated code to use epsilon. PR
It now works without “forceSharedVertices” while optimizeMesh is enabled. https://playground.babylonjs.com/#1A9AS4#5