Measuring the side lengths of 2D shapes