Hi Laurent,
I try to explain the script:
I iterate over all layers sequentially, starting in with the first layer
- ( first layer: divide layer curve in N segments)
- pull points from lower layer to current layer
- check distances: if the distances in the current layer between each point are within the limit specified by up&lowLimit create line segment (polyline) between the points. Due to the pulling of the points from the lower layer the distances between the points can vary.
- refinement: if there are any gaps between the line segments , create new polylines with more evenly spaced points between.
- proceed to next layer and repeat 1. to 4.
hope this helps.