edges incident to boundary cannot always be flipped

This commit is contained in:
Jane Tournois 2016-04-29 17:14:02 +02:00
parent eb13dffd53
commit dbedd1358d
1 changed files with 20 additions and 2 deletions

View File

@ -725,10 +725,10 @@ namespace internal {
BOOST_FOREACH(edge_descriptor e, edges(mesh_))
{
//only the patch edges are allowed to be flipped
halfedge_descriptor he = halfedge(e, mesh_);
if (!is_on_patch(he))
if (!is_flip_allowed(e))
continue;
halfedge_descriptor he = halfedge(e, mesh_);
vertex_descriptor va = source(he, mesh_);
vertex_descriptor vb = target(he, mesh_);
vertex_descriptor vc = target(next(he, mesh_), mesh_);
@ -1142,6 +1142,24 @@ private:
return true;//we already checked we're not pinching a hole in the patch
}
bool is_flip_allowed(const edge_descriptor& e) const
{
return is_flip_allowed(halfedge(e, mesh_))
&& is_flip_allowed(opposite(halfedge(e, mesh_), mesh_));
}
bool is_flip_allowed(const halfedge_descriptor& h) const
{
if (!is_on_patch(h))
return false;
if (!is_on_patch_border(target(h, mesh_)))
return true;
if ( is_on_patch_border(next(h, mesh_))
&& is_on_patch_border(prev(opposite(h, mesh_), mesh_)))
return false;
return true;
}
bool collapse_does_not_invert_face(const halfedge_descriptor& h) const
{
vertex_descriptor vs = source(h, mesh_);