Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PMP::isotropic_remeshing() - fix relaxation of constrained vertices #8604

Draft
wants to merge 3 commits into
base: 5.6.x-branch
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading