List all triangulated vertices without duplicates

I wonder if its possible to retreive a list of all triangulated vertices without duplicates for shapes.

I'm using "BRepMesh_IncrementalMesh" to mesh my shapes and can access and get the vertices per face using "BRep_Tool::Triangulation(aFace, aLoc)". Hhowever, if I want a list of all vertices (without duplicates from shared edges) it seems I would have to manually "deduplicate" the vertices, or is there some other way to retrieve all triangulated vertices?

Giovanni Bettega's picture

Hi, For a similar task I simply use this technique: while scanning all the vertices, I put them one by one into a map,std::map or TColStd_PackedMapOfInteger, every time checking if the current node is already contained (std::map::count, or TColStd_PackedMapOfInteger). It is also very fast std::set (using this you can avoid the previous check, since set elements are unique). I know this is trivial however I write this just for info about performances, which are good on very heavy meshes or surface tesselletions. Ciao