Thanks for the response. The shoelace formula was new to me and it was interesting after reading some explanation.
Unfortunately, for some reason it breaks.
It works with a 4 point plane, but not with a 16-point plane.
Here is the revised code I used
x = 
y = 
baseVector = op.GetAllPoints()
for vector in baseVector:
def polygonArea(X, Y, n):
# Initialze area
area = 0.0
# Calculate value of shoelace formula
j = n - 1
for i in range(0,n):
area += (X[j] + X[i]) * (Y[j] - Y[i])
j = i # j is previous vertex to i
# Return absolute ;
return int(abs(area / 2.0))
print polygonArea(x, y, 16)
You can also check the 4 point and 16 point plane here:
The area (since this is a square) should result to 160,000 cm2
Thank you for looking at the problem.