I am creating, by Geometry Generator, an archaeological graphical style for lines. The goal is to be able to create automatically "hachures" that connect the external perimeter to the internal line (base of slope layer called "line" in my case).
I am working on creating a point layer at the vertices of the line using the Extract vertice tool. The points are symbolised with a complex style:
- lines created with Geometry generator using the expression
shortest_line($geometry, aggregate('Lines', 'collect', $geometry))
- a triangular simple marker at the beginning of the line
Both symbols are oriented using the expression
angle_at_vertex(shortest_line($geometry, aggregate( 'Lines','collect', $geometry)),0)
The system works quite well with isolated geometries.
My problem is that when two polygons are too close, the shortest line representing the hachures is created not in the direction I would like to, but connecting the external line to the closest line "break of slope" that in many cases is the wrong one.
Any suggestion on how to fix this error and how to be able to control the behaviour of the lines?