Skip to content

Commit

Permalink
Merge remote-tracking branch 'cgal/5.6.x-branch' into cgal/6.0.x-branch
Browse files Browse the repository at this point in the history
  • Loading branch information
sloriot committed Dec 10, 2024
2 parents 793b824 + 289a8bd commit 3fa3568
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,8 @@ class Intersection_of_triangle_meshes
{
if(is_new_node)
visitor.new_node_added(node_id,ON_FACE,v_1,f_2,tm1,tm2,true,false);
else
return;

Edge_to_faces& tm1_edge_to_tm2_faces = &tm1 <= &tm2
? stm_edge_to_ltm_faces
Expand Down Expand Up @@ -677,6 +679,8 @@ class Intersection_of_triangle_meshes
{
if(is_new_node)
visitor.new_node_added(node_id,ON_VERTEX,h_2,v_1,tm2,tm1,false,false);
else
return;

Edge_to_faces& tm1_edge_to_tm2_faces = &tm1 <= &tm2
? stm_edge_to_ltm_faces
Expand Down Expand Up @@ -724,6 +728,8 @@ class Intersection_of_triangle_meshes
{
if(is_new_node)
visitor.new_node_added(node_id,ON_VERTEX,v_2,v_1,tm2,tm1,true,false);
else
return;

Edge_to_faces& tm1_edge_to_tm2_faces = &tm1 <= &tm2
? stm_edge_to_ltm_faces
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1036,15 +1036,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 @@ -1402,6 +1394,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 3fa3568

Please sign in to comment.