I’m having some trouble getting the logic working properly on this project that is matching pairs of curves. Ideally, I would like the workflow to identify matched pairs of curves that are within a nominal distance from each other (100mm) and discard the rest. Ultimately I am going to elevate one set and loft between them. Usually the curves are overlapping, but this is not always the case (as you can see from the screen shots).
The first issue is that the two inputs will rarely have the same number of curves, which causes issues when looking for closest points. The first image below shows correct matching, while the second demonstrates a problem where there are two curves in setA that are matching to the same point in setB as they are both within 100mm. So I need to work out how to eliminate the match that is furthest away.
Any help pointing me in the right direction would be great!
matched pairs.gh (19.6 KB)