Commit e5884d94 authored by Christophe Geuzaine's avatar Christophe Geuzaine

cleaner fix

parent 5361ac1d
Pipeline #3040 passed with stage
in 89 minutes and 48 seconds
......@@ -91,17 +91,28 @@ PView *GMSH_TetrahedralizePlugin::execute(PView *v)
}
std::vector<MTetrahedron *> tets;
delaunayMeshIn3D(points, tets);
delaunayMeshIn3D(points, tets); // adds 8 enclosing box vertices
std::vector<MVertex*> box;
if(points.size() >= 8){
for(unsigned int i = points.size() - 8; i < points.size(); i++)
box.push_back(points[i]);
}
// create output
PView *v2 = new PView();
PViewDataList *data2 = getDataList(v2);
for(unsigned int i = 0; i < tets.size(); i++) {
bool ok = true;
PointData *p[4];
p[0] = (PointData *)tets[i]->getVertex(0);
p[1] = (PointData *)tets[i]->getVertex(1);
p[2] = (PointData *)tets[i]->getVertex(2);
p[3] = (PointData *)tets[i]->getVertex(3);
for(int j = 0; j < 4; j++){
p[j] = dynamic_cast<PointData*>(tets[i]->getVertex(j));
if(!p[j]){ // tet connected to enclosing box
ok = false;
break;
}
}
if(!ok) continue;
int numComp = 0;
std::vector<double> *vec = 0;
if((int)p[0]->val.size() == 9 * numSteps &&
......@@ -129,7 +140,7 @@ PView *GMSH_TetrahedralizePlugin::execute(PView *v)
vec = &data2->SS;
}
else {
// tet connected to enclosing box
Msg::Warning("Skipping unknown type of data");
continue;
}
for(int nod = 0; nod < 4; nod++) vec->push_back(p[nod]->x());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment