Re: [rp-ml] STL Round off errors

From: Adrian Bowyer <>
Date: Mon Jun 12 2006 - 17:31:40 EEST

Liam MacGinley wrote:

> I have an STL question thats related to round off errors that occur in
> typical STL files.
> I have come across a number of papers which state that if two or more
> vertices are within some tolerance error value of each other then they
> can be grouped together effectively removing the round off error.
> My question is how do they come up with a value for this tolerance
> error? It would seem that if the value was too small then you may not
> remove all the round off errors. However if the value was too large then
> you could be removing vertices from the model that should not be
> removed.
> Any help in this area would be greatly appreciated.

This is not just an STL problem (though the awful STL data structure - or lack
of it - makes it worse), it's a problem throughout the whole of computational
geometry. It's also more subtle than you describe. Suppose you decide on a
tolerance and group points below it together, merging them to their average
position. Then what do you do with a chain of points, all within the tolerance
of their immediate neighbours, but where the chain-ends are quite far apart?

A good place to start is to ask yourself what problem you are trying to solve.
Suppose you are driving a real machine that can only resolve 0.01mm. Then there
is no point in going finer than that, and you might as well move all points to
the nearest place on the 0.01mm grid.

But suppose you want to extract topological information (is this thing one lump
or two?). Then an arbitrarily small geometric change can introduce a logical
change in topology. Suddenly you realise that double precision isn't enough.

If you know what you're doing you can break every CAD system ever written by
messing with its head in this sort of way...


Received on Mon Jun 12 16:39:58 2006

This archive was generated by hypermail 2.1.8 : Tue Jul 21 2009 - 10:27:52 EEST