How can Grasshopper collect the local peaks and valleys of polyline in a continuous way?

Hi,

As the pic show, I have a polyline, with peaks and valleys. I want to collect the peak and valley points in a continous way (point 1, 2, 3, 4, 5…). The Rhino file is attached.

Any suggestions and ideas are so appreciated!

kk-ring-v5.3dm (169.9 KB)

Here a way


polyline dicontinuity.gh (56.3 KB)

1 Like

Hi Laurent, that’s a perfect solution!

Thank you so much for your prompt and kind help!!