I have encountered an issue when attempting to merge GLB model geometries with three.js using BufferGeometryUtils.mergeBufferGeometries. The new merged geometries do not always align perfectly with the original model.
Furthermore, some of the geometries end up oversimplified, such as the round window in my example.
Here is the relevant portion of code:
let geometries = [];
model.traverse( object => {
if (object.isMesh){
let clonedGeometry = object.geometry.clone();
clonedGeometry.applyMatrix4(object.matrixWorld);
for (const key in clonedGeometry.attributes) {
if (key === 'position' || key === 'normal') continue;
clonedGeometry.deleteAttribute(key);
}
geometries.push(clonedGeometry);
}
});
let mergedGeometry = BufferGeometryUtils.mergeBufferGeometries(geometries);
Is there a way to ensure that the merged geometries closely resemble the original model?