NieghbourFinder is my first thought. The red points will be the candidate and the green the base. This will then fidn the closest red point to each green point. You can then use those two vertices to make the line
Thanks for the suggestion @hkingsbury. Will also have a look into that.
After reviewing my previous asked question I went back to the initial idea to extrude edge boundaries of the terrain downwards. The problem is that inefficient number of faces are created and some with gaps depending on terrain complexity. I then found the MeshSimplifier transformer suitable for optimizing faces.
To minimize overlapped faces after optimization, the trick was to split the terrain elevation into parts relative to a certain width of combined faces. Then aggregate using NeighborhoodAggregator transformer.
Short workflow description:
- Deaggregate CompositeSurface, Split Composites: yes
- LengthCalculator, get the length of each face
- NeighborhoodAggregator, Width: 55, Height: 200, Members: 1. These values could be tweeked.
- 2x GeometryCoercers, convert to: CompositeSurface > Mesh
- MeshSimplifier, Mode: Relative, Amount 0.1