Skip to content

Commit

Permalink
PMP::isotropic_remeshing() - fix relaxation of constrained vertices (
Browse files Browse the repository at this point in the history
…#8604)

## Summary of Changes

Constrained vertices, and constrained edges were not properly protected
during the smoothing step.

## Release Management

* Affected package(s): PMP
* Issue(s) solved (if any): fix #8388
* License and copyright ownership: unchanged
  • Loading branch information
sloriot authored Dec 10, 2024
2 parents 7c3e2f5 + 21e1ff1 commit 289a8bd
Showing 1 changed file with 18 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1025,15 +1025,7 @@ namespace internal {
// property map of constrained vertices for relaxation
auto vertex_constraint = [&](const vertex_descriptor v)
{
for (halfedge_descriptor h : halfedges_around_target(v, mesh_))
{
Halfedge_status s = status(h);
if ( s == PATCH
|| s == PATCH_BORDER
|| status(opposite(h, mesh_)) == PATCH_BORDER)
return false;
}
return true;
return !is_move_allowed(v, relax_constraints);
};
auto constrained_vertices_pmap
= boost::make_function_property_map<vertex_descriptor>(vertex_constraint);
Expand Down Expand Up @@ -1364,6 +1356,23 @@ namespace internal {
return true;
}

bool is_move_allowed(const vertex_descriptor v, const bool relax_constraints) const
{
if (is_constrained(v))
return false;

for (halfedge_descriptor h : halfedges_around_target(v, mesh_))
{
if (is_on_patch(h))
continue;
else if (is_on_patch_border(h) && relax_constraints)
continue;
else
return false;
}
return true;
}

halfedge_descriptor next_on_patch_border(const halfedge_descriptor& h) const
{
CGAL_precondition(is_on_patch_border(h));
Expand Down

0 comments on commit 289a8bd

Please sign in to comment.