This implements a mesh fairing algorithm and implements the fair
operations for Face Set edit. This edit operations create a smooth as
possible geometry patch in the area of the selected Face Set.
The mesh fairing algorithm is designed by Brett Fedack for the addon
"Mesh Fairing": https://github.com/fedackb/mesh-fairing, with some
modifications:
- The main fairing function in BKE_mesh_fair.h does not triangulate the mesh. For the test I did in sculpt mode results are good enough without triangulating the topology. Depending on the use and the result quality needed for a particular tool, the mesh can be triangulate in the affected area before starting fairing.
- Cotangents loop weights are not implemented yet. The idea is to expose also the vertex and loop weights in a different function in case a tool needs to set up custom weights.
The algorithm was implemented using BMesh as it was the most
straightforward way to implement it and it can be directly use by Edit
Mode tools. It should also be possible to implement it for Mesh in case
the Mesh -> BMesh conversions adds too much overhead for a particular
tool. How to implement this for multires is still not clear to me. I
have also planned to implement a simpler version of it based on the
Sculpt API in cases were speed is more important than the quality of the
surface.
This algorithm will also be used to solve the limitations of line
project and implement the Lasso Project and Polyline Project tools.
It can also be used in tools in other areas of Blender, like Edit Mode
or future retopology tools.