How to cut a cake using a template