Karel Crombecq, lead programmer and technical director for Dungeon Alchemist, open sourced the Straight Skeleton algorithm they use to generate roofs. It's a complex algorithm that took a long time to get right, tested for robustness on their large user-base, and now generously shared with the world.
It's implemented in C# for Unity, and licensed under the MIT license:
https://github.com/Briganti-Games/Straight-Skeleton-Generator
#ProcGen
