When I execute my program
C:\Users\me\Documents\projectCGALII\build\Debug>test.exe pig.obj
I get 6 intersections and when it is checked in Meshlab it say 4 intersection. This is my program:
void countSelfIntersection(const char* filename)
{
OpenMesh(filename, pm);
vcg::tri::UpdateTopology<PMesh>::FaceFace(pm);
std::vector<PMesh::FaceType *> intersections;
bool SelfIntersect = tri::Clean<PMesh>::SelfIntersections(pm, intersections);
std::cout << "Count Intersection: " << intersections.size() << std::endl;
for (std::vector<PMesh::FaceType *>::iterator it = intersections.begin(); it != intersections.end(); it++)
{
PMesh::FaceType *face = *it;
for (int i = 0; i < 3; ++i)
{
std::cout << "Vertex(" <<i<<")"<< std::dec <<(int) face->cV0(i) << " " << std::dec << (int)face->cV1(i) << " " << std::dec << (int)face->cV2(i) << std::endl;
}
std::cout<<std::endl;
}
}
int main(int argc, char* argv[])
{
nonManinfoldEdge(argv[1]);
return 0;
}
Attached pig.obj file here:
https://drive.google.com/open?id=1fEqZft_OhHxTsAvio58_TWOtvrYbGCOA
is the faces repeated in the result? How to get the right result as the meshlab does? Which is the better way to print the properties of every face or vertices in order to check that exist some repeated faces? How to remove the repeated faces if they exists?