get_polygon_length function

Calculate the polygon length of a curve