The new set of faces refer to indices of vertices actually used by the faces. So it is necessary to use the following syntax:
[V2 F2] = mergeCoplanarFaces(vertices, K);
The demo file is somewhat outdated, I will update it, and fix the doc of the mergeCoplanarFaces function.
Concerning the tolerance value, it is used for comparing normalised normal vectors of planes containing faces. There can be some numerical issues, but using 1e-4 should be fine.
16 Jun 2014
Library to handle 3D geometric primitives: create, intersect, display, and make basic computations
I've been using your toolboxes for years, thanks for some great tools.
In drawEdge3d.m, line 29, I believe is a bug, it would never get executed. The correct line might be:
elseif nargin >= 6;
Also I've complete the documentation of drawEdge3d.m for my group's use. If you want see/use my version, let me know!
Thanks for some great tools!