Grasshopper

algorithmic modeling for Rhino

hello all,

I want to make a dynamic thickness of the object depend on closest of point (attractor) to a subset area of surface.

and now, I have a list of numbers based on the distance. for example 0 - 100.

After that, I want to separate it into 5 different lists in spesific thickness.

in this case of 0-100 so it would be : 

1. if the distance 0 - 20 then the thickness is 5

2. if the distance 21 - 40 then the thickness is 10

3. if the distance 41 - 60 then the thickness is 15

4. if the distance 61 - 80 then the thickness is 20

5. if the distance 81 - 100 then the thickness is 25

But, the problem is the list of distance isn't static between 0-100. It could be 5 - 250 / 3.5-175/etc.....

Could you help me how to make the expression?? Is this possible if I make one expression?

thank you.

Z.

nb: distance and thickness hasn't mathematical relation.

Views: 2825

Attachments:

Replies to This Discussion

Try this, still needs a little work as divide domain does not start the next domain one number higher number but uses the same as the last one in the domain before.

 

 

I thought it would be much more complicated to do on grasshopper so I opted for a python script. Nice to see you used less than 5 components. 

Hello,

here is a custom python script. It works out fine. 

Attachments:

Maybe I don't understand your problem correctly, but couldn't it just be a simple expression, like the attached?

Would this work?

ahaaaa..

it works!!! thanks a lot Gui.

sorry for my late reply. I haven't touched grasshopper for a couple weeks. :D

It's been a while, but i'll leave this here in case someone sees. The solution works similar to the one by Jesús Gálvez but without the Python script. It admits any kind of conditions for each case + it doesn't use big chunks of code language.

It won't work properly if an input value fulfills two cases at the same time (as there would more resultant values than input values)

Attachments:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service