How to arrange polyline intersection points into a data tree for later weaving

Dear grasshopper friends.

I am trying to transform intersecting curves into sort of woven curves. Here is how the definition works (or should work;)

  1. intersect poly-lines with each other to get the intersection points
  2. Put the intersection points and the discontinuity points into separate lists of a data tree
  3. Move the intersecting points once up and once down and rebuilt the poly-lines with that just so they don’t intersect anymore but “dodge” each other

The datastream is organized that each list of a single polyline contains the points to rebuild the polyline plus the intersection point(s). Means if polyline1 intersects with polyline 2 both have the same point coordinates of their intersection in their individual list.
How can I tell this intersection point to move up for polyline 1 and to move down in the opposite direction for polyline 2?

Any idea is appreciated.

Here is the (19.4 KB)

I’m not sure what to suggest specifically with your current definition but here’s a tutorial I made a few years ago. The definition is on the video page as well. It may help…

Hi Brian.

Thanks for the great tutorial. But I’m afraid I can’t really use it to solve my specific problem.

I was planning to use the definition on any given bunch of random curves or polylines
intersecting with each other. With this properly working it would be possible
to weave those polylines even though they don’t have a specific order to each

One coulduse it for example on curves like these:

I have a definition that works half way but with a lot of curves still intersecting since the corresponding points are only moved randomly up and (24.9 KB)

maybe I have to consider a totally different approach to solve this.
Thanks anyway