Cull specific curves


(David S. Mavrov) #1

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.

Situation:

Needed result:

cull curves.gh (114.9 KB)


(David Rutten) #2

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.


(David S. Mavrov) #3

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!


(David Rutten) #4

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.


(David S. Mavrov) #5

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:


(David S. Mavrov) #6

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


#7

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


cull_curves_2018Jan25a.gh (121.0 KB)


(Michael Pryor) #8

Looks like it needs some serious optimization :smiley:


(David S. Mavrov) #9

Oh yeah :slight_smile: Worked. Thanks!