Centroid

Does anyone have a script that finds the centroid of a polygon (or a path) and puts the mark at the point?


Intaglio mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

It’s pretty easy to get the graphic center of a path. For example, the following script will return a bounding rectangle for the first selected path in the form {x, y, w, h}. However I believe the centroid is weighted according to the way a graphic is filled. So for example in a filled bitmap object the horizontal centroid of an object would have the same number of pixels to the left and right. This is much more complicated to calculate.

tell application “Intaglio”

set selectionList to every path in the selection
get bounds of item 1 of selectionList

end tell


Intaglio mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options