meshlab icon indicating copy to clipboard operation
meshlab copied to clipboard

the comparsion of float when removing duplicate vertice

Open DamonsJ opened this issue 1 year ago • 2 comments

when I load stl file in meshlab, I want to unify the vertice, and remove the duplicate vertice. It is in the function RemoveDuplicateVertex which is located at src\vcglib\vcg\complex\algorithms\clean.h As a result , I found it compare vertice coordinate using simple operator ==
which is located at : src\vcglib\vcg\space\deprecated_point3.h

It means if the vetex is float type , it just compare float using operator ==

Is this reasonable? Or are there other considerations?

thanks!

DamonsJ avatar Dec 28 '23 16:12 DamonsJ

Well, it depends on the application. If duplicated vertices are there because imported from a format that stores not indexed meshes, it is reasonable because the vertex coordinates are going to be likely the same, and detected with operator ==. But I agree that for some other applications, an additional tolerance could be useful.

alemuntoni avatar Feb 09 '24 08:02 alemuntoni

To use tolerance in the distances, you can use the filter "Merge close vertices" instead of "Remove duplicates"

jmespadero avatar Mar 09 '24 23:03 jmespadero