This implements the main unsubdivide algorithm which rebuilds a base mesh and extracts the grid's data from a high resolution mesh.
It includes the Rebuild Subdivisions operator, which generates all subdivision levels down to the level 0 base mesh.
What works:
- Rebuilding an arbitrary number of levels or as many levels as possible down to level 0 in a single step (not available in the main function, but very easy to enable).
- Rebuilding with already existing grids.
- Meshes with n-gons and triangles
- Base mesh made completely out of triangles
- Meshes without poles
- Meshes with multiple disconnected elements at the same subdivision level
The main function of the algorithm is multires_unsubdivide_to_basemesh
It expects an already subdivided mesh (original_mesh) and it will output the level 0 base mesh and an array of MultiresUnsubdivideGrid indexed per base mesh loop. These structs contain the coordinates in object space in the correct order to build the grid for each loop.