**How do I cull one list of curves, based on the number of intersections each member of that list makes with all items in a second list of curves?**

*My example:*

I have some circles I would like to connect to each other.

I used `curve proximity`

, now I want to dispatch any lines that intersect a circle more than a certain number of times.

I couldn’t figure out how to count the numbers of intersections, so I found a workaround (see definition below), but it prevents me from moving forward with a better version. Ideally, I would offset the lines to create rectangles, and cull any rectangle that intersects circles more than 4 times, with a 5th intersection being a check for proximity when a line passes a circle.

Definition (uses one component from Clipper Plug-in. I internalized it’s output to a curve component next to it for anyone who doesn’t have Clipper. The part visible below is what matters, further back in the definition is just generating circles. Cull Lines By Number of Intersections.gh (52.4 KB)