Center of a polygon is calculated by the average of the points, not the distribution of the mass (polygons can self intersect if memory serves, though that might only be polycurves…).
Hi, I understand that this is a cross-sectional property and not related to mass. However, it appears to be located incorrectly—it seems to be shifted along the direction of the principal axis.
I don’t see dimensions for the second shape and haven’t run this into a calculator, but for the first one [0,0.5,0.5,0.1,0.1,0.5,0.5,0] sums to 2.2, which divided by 8 gets us 0.275, which is what you showed, right?
Jacob beat me to it, but here’s a visual of what he’s saying: the “center” is weighted by point distribution - the same polygon with additional points will not have the same “center”.
It might be worth renaming the node but the description accurately states it finds the average position of points. This may not be the “mathematical” center of a polygon but it’s what the node does.
@jacob.small@Nick_Boyts I agree—if it’s just the average position, then to me it doesn’t really hold much meaning. But as @Nick_Boyts pointed out, that’s not the true center of the polygon.
Right - but centroid is not the same as ‘center’. A Dynamo Polygon also can break form the plane, which makes the formula above invalid (or I think it does).
Case in point this is a valid Dynamo polygon but not a valid mathematical polygon (though I believe it’s still a polytope):
Edit:
Oh yeah, I forgot. Genius Loci has one for surfaces, but you don’t need any curved edges for it to work (the algorithm used is written in the node).
cordially
christian.stan