Delete elements from a list if they are too close to each other

I have a set of lines generated with this little GH definition:

It looks like this:

What I need to do is check the distances between the curves and delete the ones that are closer than a given distance (4cm).
I thought of using evaluate curve at .5 and measuring that distance but I don’t know how to check every curve in the list with the other elements and how would I go about deleting the overlapping ones.


Take a look at the proximity components.


another way would be closest point then use the include domain for the distance variable.

Using start points (or any set of coplanar points derived from your lines), CullPt (Cull Dupolicates) with ‘T’ (Tolerance) input set to 4cm, right-click to ‘Leave One’. Then use the ‘I’ output (Indices as list) with List Item to get the lines that are left after culling points.

Hi Joseph, thanks for your answer!
This seems to be the way, the problem is that start points (or mid points) may be farther away than the tolerance but the lines are not. I would actually need to check ALL the points in each line against each other…

You’ll have to post the model if you want any more help from me. Silly to talk instead of exchanging code.

1 Like

Of course, I’m sorry! here it is
lineas.3dm (94.6 KB) (7.2 KB)

Now that I see your geometry, my suggestion was a waste of time. Serves me right for answering a question without any file(s) attached. Maybe an iterative solution (Anemone)?

P.S. Something similar to this?

I’ll take a look into anemone. Thank you for your time and sorry about the missing files! learned my lesson for the next one.

Try with project points on a circle and cull them with tolerance (27.0 KB)

I just found out there’s a Curve Proximity component that will tell you the closest point from two curves on each curve. How could I go about checking every curve against each other on the list? is this where anemone could come in handy?

I cobbled together a copy of the model I referred to above that gets very close to what I think you want? It yields rectangles (“regions”) not lines but the lines (inside each rectangle) can be derived… (28.3 KB)

I have no idea about your “4cm” separation spec, I used an arbitrary value, 0.099, slider in white group.

1 Like

This seems to work great Joseph, I’m very thankful for your time!