Click to See Complete Forum and Search --> : How to Find Best Position for A Label in Irregular Shape?
rayquan
June 6th, 2006, 11:25 AM
Hi, does anyone know how the find/estimate the best position for a label in an irregular shape? Assuming the range is given, but the mid point of the range is not always the best position for a posted label. For examples if the lake is in a L shape with ~50 points and I want to post its name in the middle inside the lake. If you have experience in doing so or know where to get info how to do it, please let me know. Thanks.
Raymond
nolxev
June 6th, 2006, 03:21 PM
I'm a little baffled, I think it makes no sense the best position of a label within an irregular shape. The best thing that came in my mind is to find the baricentrum/barycenter/mass_center of the shape, objects or what you want and put your label there, but for example the baricentrum of the horseshoe is out of the figure, or in a L shapes is in a place where the text will not looks good, so it wouldn't be the best way to setup the text. Did you say this?
rayquan
June 7th, 2006, 09:25 AM
Yes, you are right, nolxev. I can't just post the label in the barycenter of an irregular shape, such as L shape as you mentioned, since it will be outside of the shape. I want to find a placement point for a label inside a shape, not necessary in the middle but at some point nicely. Thanks.
nolxev
June 7th, 2006, 03:00 PM
Well, all you have to do is to imagine the text horizzontal, vertical, in the middle, at the top, at bottom and so forth until you think it looks good. Naturally you have to consider the possibility that someone could like the text in another place. Can I ask what you're developing?
rayquan
June 7th, 2006, 04:48 PM
I was given a project to write a function which would be given a shape (polygon, regular/irregular shaped) and number of points as paramters, then return the optimal position to which a label can be posted so that it looks nicely within the shape. This is not a manual process, therefore I can't adjust the location to make it look better. Thanks.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.