Calc square & perimeter
X1 Y1 N1 X2 Y2 N2 ...
Total square:
Total perimeter: