Grasshopper

algorithmic modeling for Rhino

Hey Everyone,
I`m working on a deffinition based on attractors which make a surface "bend", my problem is that I need to be able to change the values of a list depending on the attractor`s action range, but without modifying the lists order:
suposing i have a structure list
 (Paths = 75)
{0} (N = 51)
{2} (N = 51)
{3} (N = 51)
{4} (N = 51) ...............    

I`m trying to apply to that list of values the statement:
              if x>y then  x=0
              if  x<y then  x=x/z
but i need the list structure to keep exactly the same.
I`d be very thankful for any ideas on how to approach this problem.

Many thanks,
Roberto
 

Views: 1486

Replies to This Discussion

In a VBscript component:
where x,y,z are inputs and a is an output:


If x > y Then a = 0
If x < y Then a = x / z


with none of the input variables set to list

or avoiding a script,
a) if you graft your data list first you can use a boolean pattern to separate the two conditions and when you recombine each value will still maintain its proper position
b) in this particular case you could cast a boolean to an integer (True becomes 1, False becomes 0) and then multiply against your second equation in a function component
Attachments:
Thanks a lot Trevor!! I actually managed to solve partialy my problem using a weaveing pattern but it seems your solution fits better to what i`m looking for.
Cheers

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service