converted cloud_to_outline to python; test cases in main.