Peeling the longest: A simple generalized curve reconstruction algorithm. (August 2018)