Measuring line segments and polygon chains