Grasshopper

algorithmic modeling for Rhino

Hi there,

I have an enquiry concerning a definition I am trying to do :

-Z is a variable that oscillates between -1 and 16

-A is a variable that is first set to 1

Here is what I try to do :

-If Z<=0, return 1
-IfZ>=15, return -1

-If 0<Z<15, return A
 

-IfZ<=0, set A to 1
-IfZ>=15, set A to -1

How can I set my variable A? (I tried [buffer] and [store] with no success)

I need to use an object that stores a number till the input number changes

I have attached the beggining of my definition which is not finished obviously.

Thanks a lot

Views: 254

Attachments:

Replies to This Discussion

Basically :

I would like to get (This operates in time, in a loop) :

-1st iteration

for Z=13

return 1

-2nd iteration

for Z= 14

return 1

-3rd iteration

for Z = 15

return -1 (because Z>=15 set A to -1 and return -1)

-4th iteration

for Z = 14

return -1 (because 0<Z<15 A is returned and has been set to -1 at the previous iteration)

-5th iteration

for Z=13

return -1

-and so on till

Z=0

return 1 (and set A to 1)

-next iteration

Z=1

return 1

-and so on till we reach 15 and go back the other way

Thanks a lot

I am having trouble understating what you need to do but here is what I got. If you make your question more understandable, I'm sure we will figure it out.

Attachments:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service