Cull specific curves

I have a set of curves. I can´t manage to leave only certain curves. What cull pattern you´d suggest? This is a part of a very large and complex deffinition and only this little part is problematic. Because of this I can’t just select the lines, but I have to cull them in some way.


Needed result:

cull (114.9 KB)

Generate midpoints of all curves, extract x coordinates (or y, or whatever makes most sense), sort the x coordinates while sorting your curve list synchronously. I.e. plug the X values into the [K] input of Sort and your curves into the [A] input. Then extract the first and last curve from your sorted list.

1 Like

Thank you David! Amazing as always! Me being a halfwit… forgot to plug the curves into A when I tried to do it this way… Perfect!

If you zoom in on the List Item component, you can add outputs next to [i]. If you add outputs above it you can easily select the first and last item in one go.

Or you could put the values 0 and -1 into the [i] input.

1 Like

Did it this way on purpose. Depending on the geometry the number of lines is always different. This way it always works for the first and th elast one without the need of deffining anything myself. :slight_smile:

This is how this beast of a def looks like.

And there is a special little dedication there also :slight_smile:

Is there any way to align text along a line/curve in grasshopper and offset it at a given distance?

This is what David means - it doesn’t matter how many items are in the list, “-1” gets the last one: (121.0 KB)


Looks like it needs some serious optimization :smiley:

Oh yeah :slight_smile: Worked. Thanks!