Sort the points in line segments.