Entry 74 - Mesh Decompose & Rooster - August 27, 2017

Mesh Decompose Algorithm
I wrote an algorithm which allows me to automatically split meshes. You just pass in a Unity game object and you get a list of new game objects as a result.
There are currently 3 different implementations: Split by material: Simply generate a new mesh for each used material in the input mesh. If the mesh has just one material nothing will happen. Split by connected triangles: The algorithm checks all triangles and sees if they are connected. All groups of triangles which are not connected with each other become a separate mesh. Different materials also become a new mesh. Split randomly: Works like connected triangle splitting but you can define a min/max range for the triangle count of the resulting meshes. This way you can get smaller pieces.

(and no, this is not exactly what cutting down a tree will look like. It's just a demonstration of the algorithm)

Since trunk and palm fronds have different materials, they are split anyway. The palm fronds however all have the same material. They are split because their triangles are not connected with each other.