igl::loop() pairs exactly two faces per edge, running along it in
opposite directions, and sizes its vertex adjacency by the largest
vertex index in use. A repeated face, in either winding, a flipped face,
an edge shared by more than two faces, a face that repeats a vertex or
an unused vertex after the used ones made it index out of bounds. None
of these shows up as an open edge, so the menu still offered the
subdivision. Drop repeated faces, faces that repeat a vertex, which have
no area, and unused vertices. Report two faces running along an edge the
same way, as around a flipped face or on an edge of more than two faces,
as an error, which the menu already turns into a request to repair the
mesh. A clean mesh subdivides as before.
Ported from Snapmaker/OrcaSlicer@b070bcfaff
Co-authored-by: jianglinfeng <jianglinfeng@snapmaker.com>
Subdivision mesh now keeps paint on sharp edges and corners when "Keep painted feature after mesh change" is on. The paint is remapped onto the subdivided mesh before its vertices are smoothed. That mesh still lies on the old surface, and the smoothed mesh has the same triangles, so the paint data stays valid for it. With the preference off, nothing changes. The menu item no longer says "(Lost color)".