Hi,
I have encountered a problem that is too hard for me to solve, yet I know the basics of how to do it.
So let me explain, also please look at the image. I want to take these lines from the geometry on the left, and transform it into two closed squares like the geometry on the right. My idea to start was to find the intersecting points, so that later I can trim them to have my official geometry. However, I am open to any other ideas on how to solve this problem. I do not have any preferences to how you solve it, I am open to GH components as well as scripts from C# or Python.

Native version-pseudo solution. Do the following.
1_do a curve/curve intersection of all the curves( feed the component the same curves, just graft the top input)
2_ Just take out two branches that belong to the different geometry
3_further do list item and take out a single point out of the two.
4_Find the 3 farthest points to both the points. (Closest points reverse the list, the cloud point input should come from the curve/curve intersection, flatten the list and remove duplicate points( you should have a total of eight points)
5_Now merge the solution from step ‘3’ and step ‘4’.
6_ Do a convex Hull.
Hope this helps!

I want to thank all of you, for the time you spent in solving this problem for me. I didn’t expect such a number of responses, in such a short time. Even though I haven’t been on this forum for long, it is by far the best, the nicest and quickest forum I ever was in.

Here is what happened when I rotated my original figure:

@Jakinta Your first post: I don’t have the Heteroptera Region plugin, so, unfortunately, I am unable to run this script. The second solution you gave me, is working flawlessly and thanks for spending so much time on it. I noticed that the yellowish- coloured script works best.

@anon39580149 I can’t see the script you wrote, as you didn’t attach it and your image is too zoomed out for me to read the GH components and remake it.

@tognatta.aditya In your first post, I am a bit confused, which intersection do you mean? Region or solid? The second post you sent to me, it only works on curves that are horizontal or vertical.

Having said all this, I have come across a figure that the definitions decline, or don’t work with: