Skip to content
Snippets Groups Projects
Commit 91fa6119 authored by Max Lyon's avatar Max Lyon
Browse files

fix crash when trying to add incomplete cells

parent 585f1afe
No related branches found
No related tags found
No related merge requests found
......@@ -482,12 +482,27 @@ private:
auto halfface_vertices = std::vector<VertexHandle>();
auto tmp_d = d;
// rotate backwards as far as possible or back to d
do
{
if ((tmp_d->getAlpha<1>() == nullptr) || (tmp_d->getAlpha<1>()->getAlpha<0>() == nullptr))
break;
tmp_d = tmp_d->getAlpha<1>()->getAlpha<0>();
}
while (tmp_d != d);
do
{
processed_darts.insert(tmp_d);
auto equivalenceClassId = equivalenceClassIds[tmp_d->getVertex()];
auto newVh = equivalenceClassVertices[equivalenceClassId];
halfface_vertices.push_back(newVh);
if ((tmp_d->getAlpha<0>() == nullptr) || (tmp_d->getAlpha<0>()->getAlpha<1>() == nullptr))
break;
tmp_d = tmp_d->getAlpha<0>()->getAlpha<1>();
}
while (tmp_d != d);
......@@ -500,8 +515,10 @@ private:
differenceBetweenInvertedAndProperDartsPerHalffacePoly[hfh] = halfface_vertices.size()*2;
halffaces.push_back(hfh);
}
}
if (halffaces.size() > 0)
polyMesh.add_cell(halffaces, false);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment