Commit 55ea6cbc authored by Edwin Özdemir's avatar Edwin Özdemir
Browse files

minor fix

parent 6dab54a3
/*===========================================================================*\
* *
* OpenMesh *
......@@ -221,32 +220,33 @@ void MeshFixing<MeshT>::fix_topology()
// Possible relocation of vertices_ so we need to update the references!
std::vector<unsigned int>& vfaces = vertices_[v].faces;
std::vector<unsigned int>::iterator f_it, f_end(vfaces.end());
// Update the face indices of the current component
bool finished = false;
while (!finished) {
finished = true;
for (auto f_it : vfaces) {
for (f_it = vfaces.begin(), f_end = vfaces.end(); f_it != f_end; ++f_it) {
// If the face belongs to the current component
if (faces_[f_it].component == c) {
if (faces_[*f_it].component == c) {
// Iterate over its vertices
for (unsigned int i = 0; i < 3; ++i) {
// Relink to the new vertex by updating the face and pushing it in as new
if (faces_[f_it].v[i] == v) {
faces_[f_it].v[i] = newVertex;
vertices_[newVertex].faces.push_back(f_it);
if (faces_[*f_it].v[i] == v) {
faces_[*f_it].v[i] = newVertex;
vertices_[newVertex].faces.push_back(*f_it);
finished = false;
}
}
// Erase the old one
vfaces.erase(std::remove(vfaces.begin(), vfaces.end(), f_it), vfaces.end());
vfaces.erase(f_it);
break;
}
}
......
Supports Markdown
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