Grasshopper

algorithmic modeling for Rhino

Hello all.  I'm fairly new to Grasshopper.  

This may be an easy one, but is there a way to create a "gate" that allows date (in this case a integer value) to pass through if another value is "true" but restricts the data is another value is "false".

I'm ultimately using this to control a minimum unknown "tolerance" value.  I can manually increase the value of a digit counter until a panel reads "false" but that seems rather clunky.  It would be nice to just use a slider and have the data (integer value) stop increasing once the a "false" is achieved.

Thanks,

Views: 5577

Replies to This Discussion

That's it!  What is the component to the left of the panel?

"Evaluate" (Maths->Script)

I figured it out.  Evaluate an expression and add an extra variable z.  Works perfect.  Just what I needed.  Thanks Chris.

Actually, this isn't exactly what I need.  In this case I don't know what the value for "z" will be until I get a "false".

What do you mean by "but restricts the data if another value is "false"?
Does that mean that you need the "0" as an output if you get False?

If that is so, try this:

Attachments:

Sorry I'm making this so confusing.  What I need is to be able to increase a slider value until I get a "false" and then let only the last value from the slider just before the false come through even though I may still be physically increasing the slider.  I don't know what that value may be (and cannot calculate it myself) and it changes if I change other variables.

There might be a better solution than mine.
Until a better emerges, try this one:

Attachments:

"the last value from the slider just before the false" will depend on knowing the incremental increase of the slider as you move it.  In other words what is its resolution or the smallest step it makes.  Once you know this you can just subtract that amount from the threshold value to get the last true value.  In other words you can force control of this with the Range Component.  For example if your threshold value is .522 and your increment in the range component (which is replacing your slider) is .20 then the last true value will be .502. 

It might be helpful if you can post a gh file.

Here's a portion of a much larger project I'm working on.  Ultimately I'm trying to smooth out curves that overlap themselves that result from offsetting other curves.  I want to smooth out the curves to only the most minimal degree of tolerance and no more.  I set this system up to count all the number of points where a series of curves overlaps themselves.  I was having to use a digit counter and manually increase the value until the "panel" read "0".  I'd prefer it to be done automatically but couldn't figure out how to without creating a "run-time" error.  I figured if I could create a gate then I could just slam the counter to the right and only the last value before the "false" would come through.  Thanks for all your help so far.  I think the Evaluate Expression is the key, I just can't think it through all the way.

Attachments:

When reviewing the gh file the portion in question is at the bottom right.

This is ultimately a recursive problem.  Here's a solution using Hoopsnake.  You'll need to download this GHA file and place it the File>Special Folders>Components Folder from the File drop down menu.  Restart Rhino and Grasshopper and Hoopsnake should be the Extras Tab in Grasshopper.

Attachments:

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