# BufferGeometryUtils.mergeVertices - seems not to merge all identical vertices

**URL:** <https://discourse.threejs.org/t/buffergeometryutils-mergevertices-seems-not-to-merge-all-identical-vertices/33890>\
**Category:** Questions\
**Tags:** geometry\
**Created:** [January 20, 2022, 12:24pm UTC](https://discourse.threejs.org/t/buffergeometryutils-mergevertices-seems-not-to-merge-all-identical-vertices/33890 "2022-01-20T12:24:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomfree](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/tomfree/32/23649_2.png) [@tomfree](https://discourse.threejs.org/u/tomfree)\
**Post date:** [January 20, 2022, 12:24pm UTC](https://discourse.threejs.org/t/buffergeometryutils-mergevertices-seems-not-to-merge-all-identical-vertices/33890/1 "2022-01-20T12:24:05Z")

</div>

HI,  
I seem to have a weird issues with BufferGeometryUtils.mergeVertices

I took a cube from a fiddle and performed the mergeVertices and it seems mergeVertices does not merge all vertices. See [Edit fiddle - JSFiddle - Code Playground](https://jsfiddle.net/tomfree/vpdwmycn/)

E.g. the vertices given in the indexGeometry returned by mergeVertices are  
Index 0 = (-1, -1, 1, )  
index 1 = (1, -1, 1,)  
index 2= (-1, 1, 1, )  
index 3= (1, 1, 1,)  
index 4= (1, -1, 1)

i.e. vertices at position 1 and 4 seem to be the same but shounlnt after mergeVertices to my understanding. I am pretty sure that I am missing sth. Can someone point me into the right direction?

Cheers  
Tom

---

<div class="post-metadata">

**Author:** ![marquizzo](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/marquizzo/32/25192_2.png) [@marquizzo](https://discourse.threejs.org/u/marquizzo)\
**Post date:** [January 21, 2022, 10:12pm UTC](https://discourse.threejs.org/t/buffergeometryutils-mergevertices-seems-not-to-merge-all-identical-vertices/33890/2 "2022-01-21T22:12:37Z")

</div>

Answered here:

> <https://stackoverflow.com/questions/70798874/buffergeometryutils-mergevertices-seems-not-to-merge-all-identical-vertices-in>
