Library for optimising arrays of line segments.