Grasshopper

algorithmic modeling for Rhino

Assigning rule to grasshopper in combination with number slider

Okay, So here is my question. 
(Keep in mind that this is actually my first try with grasshopper. so i've got noe idea if my question might be silly or not.)

What i'm hoping to figure out is how to make a slider with "integers dividable by a certain number" (any other number would do really).
Is there somebody who can give me a quick explanation on how i can fix this(if it's possible at all)
I was hoping there would be way to make a "rule" or something smart and not too complicated.

Sincerely,

BH

Views: 1494

Replies to This Discussion

Hi Brage,

the slider only directly supports decimals, integers, even and odd numbers, so if you want it to have a different 'frequency', you'll need to do something special. You have two options:

  1. Use an Integer slider and plug it into an expression or some other logic which generates the number you're after. Downside is that it's hard to see what number you're actually setting because the slider doesn't show it directly:
  2. Use an expression on the slider:
    Giving:

Just multiply the output of an integer slider by the "certain number"?  The slider won't show the result, but that is common - like using a 0.0 to 1.0 slider to choose items in a variable length list.

P.S.  Oh!  Using an expression on the slider is very cool since the slider shows the multiplied number - thanks David.

Attachments:

Thanks guys!
I'll give it a go when i wake up tomorrow! :)

Using an expression on the slider worked like a charm! 
Thanks David!

But i have got one more question
I'll be posting a picture + the grasshopper file to show you guys what i'm trying to do.
Ok, so here it is:
I've tried to imagine making vertical blinders around an imaginary box.
(Maybe something like this would save me some time in the future to check what number and size of vertical blinders a building might need etc etc.)
ANYWAY!
I've gotten a bit stuck with what was to be the last thing i wanted to do with this coding.
I was hoping to give each of the vertical blinders a thickness (hopefully make it extrude in both directions perpendicular from the surface of each of the blinders)

I have in fact been able to extrude them but not as they should everything ends up looking weird.

Have you guys got a suggestion/tip as to how i can solve the matter?

Sincerely,
Brage

Attachments:

"the last thing"?  What about rotating the blinds?

This is a different topic from your original question...

I would suggest:

  1. using the 'Center Box' or 'Box Rectangle' component (Surface | Primitive tab) to create one blind with thickness.
  2. rotate that blind around a vertical axis.
  3. copy the result to make more blinds as needed, perhaps using 'Linear Array' (Transform | Array tab).

I guess my proficiency in english language comes a bit short. "Blinds" might be the wrong word. What im trying to make are those exterior "blinds" which rarely are made to rotate. Usually static and made to keep the worst of the sun out.

But still!
Being able to rotate the shapes is a good idea.

Not sure how to do it with my current coding though... Just gave it a few tries, and it seems i will need to divide up my geometries in an earlier stage... 

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service