Connect specific curves in a network of various curves

Hello everyone, I am desperately trying to create a GH script to connect specific curves (see image). Unfortunately, I have not been successful. I have attached a Rhino file. I am very grateful for any help.
Best regards,
Willy


M_45850_20240711_Test_join curve.3dm (60.4 KB)

could you please be more clear in explaining the problem?

1 Like

Hello @inno ,
There are lots of individual curves. I’d like to connect some of them, while others should stay as they are. (see image)
Somehow, I’m stuck :frowning: and need a push… :wink:

Best regards,
Willy

I still have no idea which curves you want to join & what your desired outcome is.

1.1 + 1.2 +1.3 = curve 1
2.1 + 2.2 +2.3 = curve 2
3.1 + 3.2 = curve 3


Sorry if I didn’t explain it clearly enough.
Best regards,
Willy

is this something like “given a List with all the Lines in the 3dm file, isolate 1.1, 1.2, 1.3 and 2.1, 2.1, 2.3 and 3.1, 3.2 and join them together”

if that is right, I think one approach might be to populate List of Lines wich are parallel to each other, and at the same time they have one end-point in common: once all the Lines are parsed, join them together

@inno sounds reasonable… can you show me a little nudge/example? :slight_smile:
Best regards,
Will

something like this, in A curves are branched by angle(s), then B filters A by common ends:

weird_line_grouping.gh (11.3 KB)

curves 1.1, 1.2, 1.3 and curves 2.1, 2.2, 2.3 are NOT parallel (!!!) so the shady Point Groups for angle-grouping and a slider to define angle-grouping-tolerance

If you have Elefront plugin you can sort curves by their color and then join only those together.
Edit: Oops I missed that you needed the blue curve to be split into two.


JOIN-CURVES.gh (7.6 KB)

Hello @inno , thank you so much for your suggestion and your time. I will try your suggestion on the big curve bunch.

My idea was to try it with vectors (vectors in the same direction). However, I’m not good with vectors :frowning: and couldn’t make any progress. Thank you again!

1 Like

Hello @ftzuk ,thank you, but unfortunately Elefront won’t be able to help here, as the data (DWG partially all in one layer) comes without any information.
The example I “colored” myself and distributed into layers.
Thank you

if you have many similar instances of that curve arrangment in the same drawing, that might require some aditional steps (probably something to separate instances), and I guess also replacing the Flattens with trim tree here and there

dirty sketch where A groups Line instances together based on midpoint proximity:

weird_line_grouping_Re.gh (19.2 KB)

Hello @inno ,
thank you again for the support. It really helps a lot.
However, I need to rethink my concept in general, as I need “cuts” (Z direction) more often than I had initially thought. Alternatively, I need to work with vectors… :wink:
A BIG thanks again!

please post some updated real-hands-on curves :upside_down_face:

1 Like

Hello @inno
thank you again for your support. Here, I’ve graphically represented once more how the curves should “join.” :slight_smile:
Best regards,
Willy

M_20240711_Test_join curve_V3.3dm (1.9 MB)

are the Lines in your 3dm file the only Lines/Curves that will be present in the final file you are going to work on?
like, by using Geometry Pipeline to import all the Curves present in the final drawing, we will get exactly 52 elements, and they will always be on XZ plane?

[edit] I’m also thinking if it’s worth to try a different approach, based on something closer to walking a graph made of those lines

the number on each Node (Vertexes) is the number of edges connected to that Node (Degree)

due to the particular conformation of this network of Lines, it happens it would be possible to identify each individual feature you request based on Node Degrees, but you need to be much sure of what Curve/Line entities your final drawing will contain… so the main question is still the same :slight_smile: when you open the drawing you have to extrapolate those data from, is that drawing exactly like the last 3dm file you attached, the one with 52 curve entities in total, or it may vary?

Hi @inno ,
you are very kind :slight_smile: … and I am lazy :frowning: .
Lazy because I HAVE to keep clients happy until Christmas.
You represented it correctly in your example. BIG Thanks!

Answers to your questions:

  1. Yes, it is just an example, and there can be significantly more curves than 52.
  2. In this example, after joining the curves, 37 curves should be the result.
  3. 1.1 - 5.3 (not pink) should join at the end, the rest remains.
  4. There always have to be interruptions (e.g., Level 1-5). Other files Level1-xy…

I couldn’t find the node (vertices)… Plugin?

Thank you again very much for your ideas, and I wish you a Merry Christmas!

Best regards,
Willy

Hi @inno ,
maybe something like this, but I’m not sure yet and need to think about it a bit myself.
Best regards,
Willy

Didn’t use any plugin for the image with Nodes and Degree on the previous post, it was just a Point Groups with low tolerance, applied to all Start/End Points of any curve in the drawing

the thing is, starting from a 3dm drawing that contains already polished data might not the best way to attack the problem… because when you try that on real-data then it won’t probably work anymore :upside_down_face:

recognizing those shapes in this drawing:

is a very different task than recognizing if/where those shapes exist in something like this :slight_smile:

I also think a graph-based approach is not feasible unless you strictly have a very limited number of Lines in your drawing

Hello @inno
thank you very much and happy new year… you challenge my brain :slight_smile: , and that is the best solution !!!

1 Like