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 definition:weavetest_10_dupl-points.gh (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
other.

One coulduse it for example on curves like these:

http://discourse.mcneel.com/uploads/default/original/2/d/2d1af88d5512aee8f25b20f50cb029e4deb5b2d2.jpg

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 down.weavetest_09.gh (24.9 KB)

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