Find and replace similar Segments in a set of curves

Hey everyone, I would like to simplify this set of curves. The goal is to find similar segments in the curves and replace them with a tween (factor 0.5) of the parent Segments. I was able to find intersection Points at exactly min_distance by using offset curves but i struggle with identifying and replacing the similar segments. Ideally I would like to also add in curve set2.

Hope someone can help.

Thanks already

similar_curve_elements.gh (16.0 KB)

Let’s talk about this. I have read your question, looked at images and studied the .gh file. And…Do not understand what you want.
Question: What are similar segments? What makes them simular?
Q2. What is definition off parent segments?

What I do understand is: When there are 3 curves more/less parallel, you could (maybe) replace the midlle one with a tween curve. But I do not recognize anything like that in the curves you made bold.

So help us, so we can help you. Regards, Eef

1 Like

Thank you for trying to help, I actually figured out a way myself. I hope this also helps to figure out my initial problem. To answer your Questions:
Similar Segments in my case meant Segments of the original curves that follow a similar path / are within a tolerance distance of each other, for the length of the segment, disregarding orientation.

Parent Segments referred to the similar Segments that should be replaced by the tween. I can see how this description might be confusing.

If someone has a better solution or even a Python or C# script for this problem I would still be interested since my solution does not work as intended when adding in Curve_set2, but for now my solution is sufficient for my purposes.

similar_curve_elements_solved.gh (34.8 KB)

So we can learn something from you:

  • Please remove the plugin components, so we do not have to install (and uninstall this for this example)
  • explain how you solved it.
    That would be some revenu for the time I invested.

Regards, Eef