Getting every other line segment?

Goal: Of the interpolated line, extract every other line segment, defined by the circles. In the example, these are the long line segments, i.e. the ones between circles 0 and 1, and between circles 2 and 3. (In reality, there are a lot more circles.)

As you can see, I tried combining Curve | Curve intersection with Shatter. While the result contains the line segment between circles 0 and 1, the line segment between circles 2 and 3 is missing.

Any idea how to approach the problem?

segments.gh (7.8 KB)

Screenshot of Grasshopper

one way:

segments_J.gh (9.1 KB)

This looks like a good solution, thanks!

Interestingly, when opening your file in Grasshopper WIP, then I get error messages:

The errors can be removed by deleting an invisible character at the end of each lιst in the yellow panels. It almost looks like there is an issue with Mac vs. Windows line endings. Did you use Mac Grasshopper?

yes, i use Mac.

and likewise, when i first open your file, i get :

(no circles or interpolated curve being draw)

the way i made the panels work (on mac) was:
• double-click the panel to edit it.
• select the contents
• cut
• paste

then it works.


@dan , you may want to have a look at this if you get a chance… download the .gh in the top post and open it on Mac.

.