# Flip curves with midpoint to the left or right of some point?

I have a single list of curves. I need to flip half of them. I know that those curves all have a midpoint to the right of the total center (-y in my case).

How do I separate these curves out from the one list I have?

could curve side component be useful here?

lots of ways to do it in Grasshopper, files help in this case.

In Rhino you can grab the curves and type in Flip.

Yes, thatâ€™s a good hint. I guess I still need some hints on how selectors/conditionals work in Grasshopper.

I need to keep this in Grasshopper.

curve-flip.gh (89.5 KB)

1 Like

Thank you! Iâ€™m trying to understand this right now. The â€śfirst numberâ€ť that you put at 0, really should be the midpoint of the diagonally projected curve that I shatter with, right?

(This makes me wonder if thereâ€™s a way to sort a list of curves in ascending z-location order, and then sort a list of points in the same order, and then compare the starting point of the curves with the point at the same index in the list, and if it differs flip itâ€¦ since I shattered, I have twice as many curves as points, but in this case I could just duplicate the points before I sort themâ€¦ hmmâ€¦ tall order for a beginner, but I want to attempt thisâ€¦)

So I did it. Once you had introduced me to the larger than and dispatch nodes (really weird name, btw), I managed to solve it pretty quickly:

Itâ€™s slightly simplified compared to what I said I was going to do, as I just compare to one point.

Thank you so much for the help!

Do you mean like that

curve-flip_2.gh (89.8 KB)

2 Likes

Wow. That was amazing. Sorry @Rickson, but I have to switch the correct answer to this one. Yours helped me, but this one is so slick!

@anon39580149 how do you draw the white arrows which indicate the direction?

I baked them and use Rhino to show the direction but you can use Grasshopper

1 Like

Fantastic, thanks again!