How to get ngon center
-
On 06/08/2017 at 13:38, xxxxxxxx wrote:
Hi guys!
Anybody knows how to obtein ngon center using polygon list?
I tried different methods, including summation of polygon centers with the subsequent division by count.
But then I found this article and I felt somehow sad.
https://en.wikipedia.org/wiki/Centroid -
On 06/08/2017 at 14:51, xxxxxxxx wrote:
What kind of center do you want, and what for? An ngon is not necessarily planar, not necessarily convex, and not necessarily non-self-intersecting. The "center" may not even lie on the surface of an ngon even for a planar one. So what you are looking for depends on the purpose.
Easiest mean may be (max-min)/2 for each coordinate and all points (but this will put more emphasis on outlying points). You already mention the mean of polygon centers, or you could use the mean of points (which will put emphasis on dense subpoly areas). Or you could go for the centroid as the article describes.