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

dix

parent e46b0756
No related branches found
No related tags found
No related merge requests found
......@@ -146,7 +146,7 @@ int GModel::readSTL(const std::string &name, double tolerance)
MVertexRTree pos(eps);
pos.insert(vertices);
std::set<MFace,Less_Face> unique;
std::set<MFace, Less_Face> unique;
int nbDuplic = 0;
for(unsigned int i = 0; i < points.size(); i ++){
for(unsigned int j = 0; j < points[i].size(); j += 3){
......@@ -157,7 +157,10 @@ int GModel::readSTL(const std::string &name, double tolerance)
double z = points[i][j + k].z();
v[k] = pos.find(x, y, z);
}
MFace mf (v[0], v[1], v[2]);
// FIXME: is this unicity test really useful? it slows down large STL
// reads. It would be better to provide an API to detect/remove duplicate
// elements
MFace mf(v[0], v[1], v[2]);
if (unique.find(mf) == unique.end()){
faces[i]->triangles.push_back(new MTriangle(v[0], v[1], v[2]));
unique.insert(mf);
......@@ -167,7 +170,7 @@ int GModel::readSTL(const std::string &name, double tolerance)
}
}
}
if (nbDuplic)
if(nbDuplic)
Msg::Warning("%d duplicate triangles in STL file", nbDuplic);
_associateEntityWithMeshVertices();
......
......@@ -112,18 +112,16 @@ GRbf::GRbf(double sizeBox, int variableEps, int rbfFun,
pos.insert(vertices);
for(unsigned int i = 0; i < vertices.size(); i++){
MVertex *v = vertices[i];
pos.find(v->x(), v->y(), v->z());
if(!pos.find(v->x(), v->y(), v->z()))
myNodes.insert(v); // keep only no duplicate vertices
allCenters(i,0) = v->x()/sBox;
allCenters(i,1) = v->y()/sBox;
allCenters(i,2) = v->z()/sBox;
_mapAllV.insert(std::make_pair(v, i));
}
// keep only no duplicate vertices
for(unsigned int i = 0; i < vertices.size(); i++)
if(vertices[i]->getIndex()) myNodes.insert(vertices[i]);
// initialize with points
nbNodes= myNodes.size();
nbNodes = myNodes.size();
centers.resize(nbNodes,3);
normals.resize(nbNodes,3);
int index = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment