meshlab
meshlab copied to clipboard
the comparsion of float when removing duplicate vertice
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!
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.
To use tolerance in the distances, you can use the filter "Merge close vertices" instead of "Remove duplicates"