Note: The method of this post is too naive to be applied in sophisticated applications. So please think twice before applying it to yours.
QSlim is a light-weight software developed by M. Garland, which can simplify mesh models swiftly, maximally preserving their geodesic properties. However, in my recent use of it I discovered a “bug” regarding redundant faces.

I generated a L shape whose faces consist of redundant triangle mesh (figure left). However, after QSlim, the result is as the middle picture shows. The shape is damaged and faces are “out” of the original shape. I fixed the problem and my result is as the right picture shows. There exists known problems (it seems that some faces are facing the inside), but the major problem is resolved for redundant models.

When debugging Garland’s program, I found that in the project MixKit, the main QSlim file MxQSlim.cxx encounters the following problem: sometimes the optimized new point of a contracting edge causes an error that’s negative, which is obviously unreasonable. So I punished this error, and made an small adjustment to ensure that even error is zero, the area factor of quadrics still works. For details and compiled version, see Resources.

I may update this bugfix later when I have time, to fix the known problem of face direction.

Resources

For windows users, please feel free to download the compiled “bugfixed” QSlim 2.1 qslim.zip

For people using other platforms or people wanting to compile on their own, I added these code to the MxQSlim.cxx file, at about Line 374, in function void MxEdgeQSlim::compute_target_placement(MxQSlimEdge *info), just after the big if-else:

if (e_min < 0) e_min += 1e200; // The punishment of negative error, make it a great positive error
e_min += 1e-10 * Q.area();  // Make sure that area works even the error is zero

See Also…

Read my blog and find out how I compiled QSlim 2.1 with Garland’s outdated .dsw file under Windows + Visual Studio.