Sorting in grasshopper of (overlapping)superimposed lines

Hello everyone,
I’m trying to build a definition for sorting overlaid lines
the task is as follows there are green lines and on them are superimposed red lines (see screenshot)
you need to form a list of red lines so that on the list branches there are only those lines that lie on their green lines?

tried to make a universal definition with the help of minimal distance, but this approach does not always work

overlapping lines.3dm (24.2 KB)
overlapping (2.8 KB)

Like this?

overlapping (12.9 KB)


Thank you so much HS_Kim
I tried in other ways not through the shortest distance to the line
maybe what kind of plug-ins do it?
or is there another way?

Why do you need to find a plugin for this? If you’d like to get the same result using other means, then Just do collision test if you want. But, in this case you can use Extend Curveto shorten the line length a little bit to avoid to be detected by two different underlying lines simultaneously at the corners…

overlapping (10.8 KB)

1 Like

Thank you so much HS_Kim
very interesting approach