I'm trying to fill entities (polygons from 3 to x points) with a texture that I want to align with the 'general' orientation of each polygon, ie, I need a formula to assign to the Rotate field of the polygon style (red circle on the image).
I guess the function would have to determine global polygon orientation by reducing the polygon to its box and calculate the ration height/length.
Unfortunately, I'm not skilled enough with programming. How would you do that?