I want to be able to calculate the longest edge of a rectangle polygon to create an expression for a style.
The styled rectangles will have variable orientations, widths and lengths.
I want to use this longest length to create an expression for the spacing of the Line Pattern Fill of the polygon style. The spacing will be set to 1/3 of the longest length of the polygon, so that the rectangle is visually divided into three segments (the rotation is already set to be -(main_angle($geometry))
).
As an example, the distance of the longest edge is 3.501 m, which divided by three equals 1.167 m. This value (1.167 m) is set as my spacing. The effect is what I am after, I just want to automate this without manually calculating the 1/3 of the longest edge!