Grasshopper

algorithmic modeling for Rhino

Does anyone know how to merge/join 2 lines that overlap into a single line?

Views: 3825

Replies to This Discussion

Can you post an image/file? Lines or curves?

One way is to find the intersection, trim, and then join.

Thanks Gui,

The lines are non-overlapping, then they gradually overlap as you work your way up. Ideally I would like to do this from a flattened list of curves because right now the left and right 'columns' are not in separate lists.

I believe they are curves, but could be converted to lines if necessary.

Hi Max - 

You said "merge/join" 2 lines, but in reality you have a few dozen lines, grouped together in 2 "groups" that merge to form one.

Are you trying to create a surface out of these 2 merged groups like in the terrible sketch attached)?

Can you share the definition?

Well, they aren't grouped into separate groups - that is the main problem I'm running into.

Basically my question is - if I gave you these curves in rhino like the screen shot above - how would you take those curves in grasshopper (as a flattened list) and output single curves where they are overlapping?

Does the JoinCurves component work?

Reference the curves in GH then plug them into JoinCurves.

You might need to reference each set of curves seperately and play with the lists so the right curves are joined.

No, the curves overlap (the endpoints do not meet) and they are in a single flattened list.

The screenshot above represents a small condition of a larger data set, so it is not ideal to have to to separate the curves into separate lists first.

I'd suggest something similar to this approach, just use tree/list logic to construct all your lines in one go. Hope it helps.

Also, for future reference see item three in this post.

/SPM

Stephen,

Thank you for your help, but I'm not sure posting a grasshopper definition is relevant in this case. The starting point is a flattened list of curves where some of them overlap. If it helps to have a rhino file I've attached one that contains a sample of curves that I'm working with.

The problem with your solution is that it doesn't differentiate between curves that do and don't overlap. 

Attachments:

Thanks for sharing the 3DM file. I was able to achieve what you're looking for with some (not very elegant) sorting methods. See attached.

P.S. I'm using the Human plugin to reference, bake, and visualize geometry.

Attachments:

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service