how to compute perimeter of irregular shape object