I want to create a symbology (line type) for a point layer in QGIS. This line must be perpendicular to the segments of a polygon. I attach an image:
To do this I entered an expression in the rotation section of the symbol The expression is this:
degrees( azimuth( $geometry, closest_point( aggregate( 'lotto', 'collect', $geometry, intersects($geometry, $geometry) ), $geometry ) ) )
However the symbology of points 1, 2, 6, 7 is correct, while that of points 3, 4, 5 is not, as the calculated rotation value is 0.
How can I also make points 3, 4, 5 perpendicular to the various segments? is it possible by modifying this expression or do I have to use another approach.
The layers in question are two different, a point layer and a polygonal one.