algorithmic modeling for Rhino
I wa wondering if anyone could explain the mathematical method Grasshopper applies for calculating the centroid of a surface/curve, I'm aware that the Polygon Center component uses the average of the vertices and or the average of the edges to calculate the center of a polygonal curve, but I'd like to understand the method it uses to calculate the centroid of an irregular planar curve/srf in the Area Component.
Thank a lot.
Tags:
I had several centroid (not to mention ...er...umbrella sticks[don't ask] stuff) related examples just for fun (polys, curves, cats, dogs, whatever comes first) ... but a recent major crash (in 2 workstations simultaneously: Karma, what else?) caused "some" MIA stuff, he he.
Until I'll fix(?) things(???) get this polygon related thingy that explains the approach (obviously you should "read" the code).
PS: test polys are internalized (I do hope that GH ... blah, blah).
best, Peter
It uses the Rhino SDK methods, and I'm afraid I don't know the methodology they took, though you can try asking on our discourse forum where the Rhino programmers hang out.
Curves are converted to single face breps for area calculations, but the polygon centroid component (which is way faster) calculates three kinds of centroid:
Welcome to
Grasshopper
© 2025 Created by Scott Davidson.
Powered by