# Easy way to get the area of a polygon? Classic List Threaded 14 messages Open this post in threaded view
|

## Easy way to get the area of a polygon?

 This post was updated on . Hi Anyone know an easy way to get the area of a polygon? Since a polygon is essentially made up of triangles I presume this is not too hard. Anyone got a solution? I don't want to waste valuable time reinventing the wheel. Thanks Ex.
Open this post in threaded view
|

## Re: Easy way to get the area of a polygon?

 I can't provide verification of this particular program, but it purports to do as you require: http://codecanyon.net/item/3d-surface-area-calculator/10457510At US\$11.00 it would be a small gamble.
Open this post in threaded view
|

## Re: Easy way to get the area area of a polygon?

Open this post in threaded view
|

## Re: Easy way to get the area area of a polygon?

Open this post in threaded view
|

## Re: Easy way to get the area area of a polygon?

Open this post in threaded view
|

## Re: Easy way to get the area area of a polygon?

Open this post in threaded view
|

## Re: Easy way to get the area area of a polygon?

 It should be noted that all this is true for simple polygons. function area(p) = abs( sum_list( [ for(i=[0:len(p)-1]) cross2D( p[i], p[(i+1)%len(p)] ) ] ) )/2;   function sum_list(v, i=0, sum=0) = i==len(v) ? sum : sum_list(v, i+1, sum+v[i] ); function cross2D(p, q) = p*q - p*q; p = 10*[ [1,0], [2,0], [2,1], [1,1] ]; q = 10*[ [1,20], [2,21], [2,20], [1,21] ]; polygon(p); polygon(q); echo(area_p=area(p)); echo(area_q=area(q));
Open this post in threaded view
|

## Re: Easy way to get the area area of a polygon?

Open this post in threaded view
|

## Re: Easy way to get the area area of a polygon?

Open this post in threaded view
|

## Re: Easy way to get the area area of a polygon?

 doug.moen wrote Self-intersecting polygons do not work, which is inconsistent with the polygon() primitive. So the area won't match what polygon() draws on the screen in this case. To calculate area or even to fill a self-intersecting polygons is ambiguous. The drawing of a self-intersecting polygon done by primitive polygon() is just one of the alternatives. Consider an extrusion of the polygon: p = [ [0,0], [7,0], [7,7], [3,7], [3,3], [10,3], [10,10], [0,10] ]; polygon(p); which has a hole in it. If you process that extrusion with slic3r and Simplify3D you will get rather different results. Each one choose its own interpretation of the hole of polygon(). Slic3r does preserve the hole, Simplify3D fill it. And nobody can argue that one of them is wrong.
Open this post in threaded view
|

## Re: Easy way to get the area of a polygon?

 In reply to this post by Experimentalist Hi Thanks everyone for your answers, I shall play Ex
Open this post in threaded view
|