Grasshopper

algorithmic modeling for Rhino

Hello, I have two lists of points, say 1 and 2. I want to use alternatively one list or the other depending on the occurrence of an event.

I start taking points consecutively from list 1; then, when point n+1 has higher x than point n, I switch to list 2. I use points on list 2 unless point n+m has lower x than point n+m-1; at this time I come back to list 1. And again as before , when point  n+m+p is higher than point n+m+p-1 I go to list 2. I do so until the end of one list of points.

i saw I can get a list of 'true -false values' from the 'if minus' function, but how to switch , possibly automatically, between lists?

Thank you all!

Views: 548

Replies to This Discussion

I doubt this is possible without custom scripting. The algorithm you describe requires customized looping and conditionals which is not typically possible using 'straight-up' Grasshopper components.

If you can post the two point lists and maybe a (partially) hand-drawn solution, I can try and come up with a script that does it automatically.

Hello, I attach a simplified file. if you look at the solution, maybe I need something simple because actually I have just to merge the true values of a list.

Thanks! 

Here are the files

Attachments:

Hi Valentina,

I must be very confused, the file you posted simply collects from two equally long lists the smallest value. But what I understood from your initial question was that you wish to extract consecutive values until the next value is less than the previous one. These are two very different problems.

You can use the Min component to find the lowest of two numbers:

You are absolutely right. Just I noticed that, in the real situation, the not wanted values are all negative, and so... !

Thank you for the Min component, and sorry for late reply!

RSS

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service