<h5 dir="auto">Description of the problem</h5>
<p dir="auto">There seems to be a bug when copying from a buffer geometry into another existing buffer geometry, which causes groups to be appended, instead of replaced.<br>
I don't think this is working as intended.<br>
<a href="https://github.com/mrdoob/three.js/blob/master/src/core/BufferGeometry.js#L1017-L1024">Problematic code</a></p>
<p dir="auto">I think this needs a clearGroups() call before starting to add groups.</p>
<h5 dir="auto">Three.js version</h5>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Dev</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> r82</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> ...</li>
</ul>
<h5 dir="auto">Browser</h5>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> All of them</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Chrome</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Firefox</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Internet Explorer</li>
</ul>
<h5 dir="auto">OS</h5>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> All of them</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Windows</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Linux</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Android</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> IOS</li>
</ul>
<p dir="auto">I was loading an .obj with ~70k vertices, and it was taking ~20s to load the model. The slowness was being caused by <code class="notranslate">mergeVertices</code> call here:</p>
<p dir="auto"><a href="https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/OBJMTLLoader.js#L101">https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/OBJMTLLoader.js#L101</a></p>
<p dir="auto">I commented it out just to see what would happen, and it took about ~1s to load the model and there was no visible change. Any ideas?</p>