polydata surface border as polyline

This was just what I was looking for, I spent over an hour trying to write an algorithm that reordered the points but realized this must already be an anticipated/desired output structure