How to add a ceiling to a model with funky angles

Thanks very much for that, it looks very useful but I don’t quite understand what it achieves, would you please clarify? Thank you!