mrdoob/three.js — pull request #2867 by bhouston (2012-12-31 14:10:40+00:00)
Title: Geometry.mergeVertices fix + webgl_geometry_normals.html example

This PR fixes a set of bugs in Geometry.mergeVertices:

* It did not handle Face3s that end up with duplicate vertices after a merge.

* It did not handle Face4s that end up with more than one duplicate vertex after a merge.

* It did not handle Face4s that has vertexNormals or vertexColors.

I wrote an example that demonstrates the last bug mentioned above and that it is fixed. It is webgl_geometry_normals.html. Just merge in this PR but do not regenerate three.js or three.min.js. Run the example and select the LatheGeometry -- it will not display properly. Now re-build three.js/three.mins.js via build.bat or equivalent. webgl_geometry_normals.html now works with all geometry types.

I don't have examples of the first two bugs in this PR, but I do demonstrate in the example that this code still functions as expected.