Fuses together vertices and faces in bad meshes.
Via npm:
npm install fuse-vertices
Take a bad mesh, for example the Utah teapot:
var teapot = require('teapot');
And then call the method:
var repaired_teapot = require('fuse-vertices')(teapot.cells, teapot.positions, 1e-4);
This function fuses together all vertices which are within tolerance
distance of one another. It takes the following parameters:
cells
a cell complexpositions
the positions of the cellstolerance
fuse threshold
Returns an object with the following properties:
cells
: The fused cellspositions
: The positions of the fused verticesvertexRelabel
: A relabelling of the vertices
(c) 2013 Mikola Lysenko. BSD