Skip to content
Snippets Groups Projects
Commit 210c8278 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

dump file with intersecting faces when tetgen fails

parent aaf53c20
No related branches found
No related tags found
No related merge requests found
...@@ -282,14 +282,25 @@ void MeshDelaunayVolume(std::vector<GRegion*> &regions) ...@@ -282,14 +282,25 @@ void MeshDelaunayVolume(std::vector<GRegion*> &regions)
sprintf(opts, "dV"); sprintf(opts, "dV");
try{ try{
tetrahedralize(opts, &in, &out); tetrahedralize(opts, &in, &out);
Msg::Info("%d faces self-intersect", out.numberoftrifaces); Msg::Info("%d intersecting faces have been saved into 'intersect.pos'",
out.numberoftrifaces);
FILE *fp = fopen("intersect.pos", "w");
if(fp){
fprintf(fp, "View \"intersections\" {\n");
for(int i = 0; i < out.numberoftrifaces; i++){ for(int i = 0; i < out.numberoftrifaces; i++){
Msg::Info("face (%d %d %d) on model face %d", MVertex *v1 = numberedV[out.trifacelist[i * 3 + 0] - 1];
numberedV[out.trifacelist[i * 3 + 0] - 1]->getNum(), MVertex *v2 = numberedV[out.trifacelist[i * 3 + 1] - 1];
numberedV[out.trifacelist[i * 3 + 1] - 1]->getNum(), MVertex *v3 = numberedV[out.trifacelist[i * 3 + 2] - 1];
numberedV[out.trifacelist[i * 3 + 2] - 1]->getNum(), int surf = out.trifacemarkerlist[i];
out.trifacemarkerlist[i]); fprintf(fp, "ST(%g,%g,%g,%g,%g,%g,%g,%g,%g){%d,%d,%d};\n",
v1->x(), v1->y(), v1->z(), v2->x(), v2->y(), v2->z(),
v3->x(), v3->y(), v3->z(), surf, surf, surf);
} }
fprintf(fp, "};\n");
fclose(fp);
}
else
Msg::Error("Could not open file 'intersect.pos'");
} }
catch (int error2){ catch (int error2){
Msg::Error("Surface mesh is wrong, cannot do the 3D mesh"); Msg::Error("Surface mesh is wrong, cannot do the 3D mesh");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment