I've written a tool that fills a polygon in ArcMap with parallel lines at a user specified distance apart and at a user specified angle, written in vb.net and arcobjects. What i'm looking to do next is write a tool that calculates the most efficient angle at which to draw these lines (i.e. the angle which fills the polygon with the least number of lines, or greatest average line length), given the specified line separation distance.
For example if the polygon was a simple rectangle, then the most efficient line angle to fill the rectangle would be parallel to the long axis, as it would take more lines to fill the polygon if they were drawn parallel to the shorter axis. For more complicated shapes I have little knowledge of how to achieve this.
The only way I can think of doing it is to write a loop that creates lines at every angle and then pick the output with the greatest average line length, but that would take too long (drawing each set of lines takes a good 5-10 seconds depending on the number of lines).
I know it's a longshot but does anyone have any ideas? Probably quite a tricky one...