Grasshopper

algorithmic modeling for Rhino

Hello everybody,

 

I have a proble with Data Management. I try to convert my Parameter List to specific Values. I have a list of parameters where the values are betwenn "0" and "1" so I want to seperate the values and get only 7 different values. For example this schould be like this:

 

The values between 0 and 0.5 will converted to 0.4 while the values betwenn 0.5 and 1 will converted to 0.8

 

Mathematical Discription:

 

if  0.0 < x < 0.5  than "0.4"

if  0.5 < x < 1.0 than "0.8"

 

I try to solve it with boleans (Or, And, Xor, Ternary etc. Gates) but not succes. Is there a possibility to solve it with Funktions? Or have any body for me a clue hove to convert datas tu specific values.

 

Thanks,

 

ILIAS

 

Views: 1965

Replies to This Discussion

Because you only have values between 0 and 1 if you converted them into integers you would have zeros for all values less than 0.5 and ones for those greater. This forms a pattern from which you can weave your intended values into a list. See Image below.

Alternatively you could try something like this: http://www.grasshopper3d.com/forum/topics/replace-null-items-in-a-l...
Dany Thank you very much. I can work with this system like Boleans :-) I just search for a solution like this in grasshopper...
Hi Ilias

you can also use a c# component in GH07 with x as List of double


if(x.Contains(double.NaN))
return;

List num = new List();

for(int i = 0; i < x.Count;i++)
{
if(x[i] > 0 && x[i] < 0.5)
num.Add(0.4);
else
num.Add(0.8);
}

A = num;
Hi Thomas

woow cool I will try it Thank You :-)
Hey no problem
how are you?
did you get response from our university?
Hey Thanks How are You? How is going your work I hope every think is in best situation.

You mean from University Innsbruck? Unfortunately I didn`t get any answer and the time to register in stuttgart for the next semester was short I had to suspend it. So this semester I am in Stuttgart maybe for the next semester I am there I will make a new application.

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