Files
cgal/Polygon_mesh_processing/include
Sebastien Loriot 0dee36c764 Better flip-check criterion for almost degenerate face removal (#8743)
## Summary of Changes

While trying to remove caps, `PMP::remove_almost_degenerate_faces()`
does a Delaunay-like check before allowing the edge flip. Unfortunately,
the current criterion (see https://github.com/CGAL/cgal/pull/7125) can
prevent some edge flips that would resolve a cap because sometimes this
Delaunay-like criterion can prefer a cap if it is balanced by a very
small angle on the other side. Then you have alpha + beta < 180 and
you're stuck with the cap, but maybe you would have liked to flip still
because the largest angles created by a flip would be e.g. 120 and 120,
which is not that bad.

However in this function, we are maybe not so interested in having
nicely shaped elements as much as we are trying to remove the worst
elements. So this PR tries to improve the worst cap angle instead, by
checking only (and greedily) if we do not create a worse cap angle when
we flip.

This produces better results for the cases that were problematic with
alpha + beta < 180

## 1

![image](https://github.com/user-attachments/assets/313b8c1f-8ea4-4153-a41b-406f16d4153c)

## 2

![image](https://github.com/user-attachments/assets/cb74230a-70c1-4ef9-bb73-378331cd1626)

## 3

![image](https://github.com/user-attachments/assets/b31ec7f7-21b0-49c1-bb69-2174f0e5bf86)


## Release Management

* Affected package(s): `PMP`
* Issue(s) solved (if any): 
* Feature/Small Feature (if any): - 
* License and copyright ownership: no change
2026-01-19 09:34:20 +01:00
..