Find The Best Area On A Surface For Text Placement

Hi Everyone,

Been struggling with this one for a while now and would appreciate some help. I am trying to place text (labels) on varying surfaces that often include holes. Evaluating the surfaces etc lets me move the text manually one by one but ideally I’d like to find the optimal position and pin point the best place for text on each different surface.

It would also be great if the text could scale in size / align and rotate to fit and avoid holes.

Essentially the text in this case could be any geometry - i think it comes down to just figuring out how to add a plane on a surface in the best position. (I’d only be adding 5 or so letters of text)


You could find the largest rectangle and its orientation, then put your label in the middle of it.

NOTE: This simplistic algorithm obviously doesn’t really find the largest rectangle…

1 Like

Good for circles, less so for oriented labels, esp. “Part #2”. And ~300 lines of C# code is a little intimidating for dilettantes like me. Three out of four similar locations though.

1 Like

Ah yes, oriented rectangles is a bit different

Thanks for the help. I’ll have a go at putting something together based on what you’ve provided