Skip to content

Commit

Permalink
Flip it if you can't collapse it (#8609)
Browse files Browse the repository at this point in the history
if a needle is also a cap, it will be handled as a needle only. But if
we can't collapse the edge, a flip will not be tried. Try the flip too.

Note that this will slow down the method as the status of a triangle is
tested twice.

Fix #8605
  • Loading branch information
sloriot authored Dec 23, 2024
2 parents b55bdc0 + 0737a8f commit 06fa730
Show file tree
Hide file tree
Showing 3 changed files with 176 additions and 114 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -871,14 +871,14 @@ namespace internal {
std::array<halfedge_descriptor, 2> r1 = internal::is_badly_shaped(
face(he, mesh_),
mesh_, vpmap_, vcmap_, ecmap_, gt_,
cap_threshold, // bound on the angle: above 160 deg => cap
4, // bound on shortest/longest edge above 4 => needle
cap_threshold, // bound on the angle: above 160 deg => cap
0,// collapse length threshold : not needed here
0); // flip triangle height threshold

std::array<halfedge_descriptor, 2> r2 = internal::is_badly_shaped(
face(opposite(he, mesh_), mesh_),
mesh_, vpmap_, vcmap_, ecmap_, gt_, cap_threshold, 4, 0, 0);
mesh_, vpmap_, vcmap_, ecmap_, gt_, 4, cap_threshold, 0, 0);

const bool badly_shaped = (r1[0] != boost::graph_traits<PolygonMesh>::null_halfedge()//needle
|| r1[1] != boost::graph_traits<PolygonMesh>::null_halfedge()//cap
Expand Down
Loading

0 comments on commit 06fa730

Please sign in to comment.