Up spake bulia byak:
AFAIK, you can't use the gravitic center (my terminology), only the bounding-box center. If there's already an RFE, submit one. It sounds a useful feature.
Will it be useful not only for triangles?
Well, I can't think of anything that I'd use it for, but is that any reason not to do something?
If you use a gravity center for an arbitrary path, its curved parts with many nodes will be heavier than smooth parts. Is this what you want?
I was thinking of center of gravity being based on area.
Let O be the object. Let G be the center of gravity of O. Let Ri be a ray from G to infinity such that the minor angle between the base ray and Ri is i. Let Rj be another such ray, such that the minor angle between Ri and Rj is j. Let Aij be the area of O between Ri and Rj. G is the point that best satisfies the following condition: (approximates (quotient (sum (n in 0 to (product 2 Pi)) ;; interval is 1 (radian) (sum (m in 0 to (product 2 Pi)) ;; interval is 1 (radian) Anm)) (product 2 Pi 2 Pi)) 0)
That's rather messy, slow and probably incorrect. It's two days past my bedtime.
Also not all objects have nodes (e.g. <image> has no nodes), and a line of text has so many scattered nodes that this metric becomes useless IMHO.
(Non-transparent) images are rectangles. Text follows the same algorithm, but it'd be as slow as a complex path.