Grasshopper

algorithmic modeling for Rhino

Can anyone tell me how, or if it is possible fundamentally to have:

 

2 sliders that are inserted into a function, and as one slider is changed the other slider is affected, for example as the fist slider is increased, the second decreases according to the function?

 

Thankyou!

Views: 2468

Replies are closed for this discussion.

Replies to This Discussion

Hi Conor,

 

nope.

 

But it seems odd you would want to use a slider for this. If you want to link a second value to a slider, just do the math without a second slider. Basically my question is; why do you want two sliders to change a single value?

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Just like a semi-automatic camera. You can either set the aperture or the shutter speed. (The camera will calculate the other value in order to get the right exposure).

Ok, what would the user interface for this look like?

 

I suppose you'll want to enter an expression somewhere? Does this expression need access to other Grasshopper data or does it contain only constants? Do you want to use Grasshopper components to define the relation between these two sliders? Is it only ever two sliders, or should it be possible to hook any amount of sliders together?

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

More than two sliders seems tricky. (If you change one, which one of the others should change?) 

You would somehow have to "lock" the relation between two sliders with a function. But possibly also set a master/slave relation in order to determine which slider should change to match the function at the start.

I realize some of the difficulties with this whole idea and I wonder if it's really worth the trouble...

i think not. i would only add some interface mods to the slider, see my post to know what i mean.

So if you change slider A to be 4, then that would mean that slider B should be set to 12/(2*4) = 1.5 right? Except it can't because it's an integer slider. And what happens when the value is outside of the slider domain?

 

You'll need to define two expressions, one that tells me how slider B should change when slider A is dragged around and vice versa. One equation is not enough (even beyond the difficulties of solving it both ways, you'd basically need a very advanced mathematical algorithm). Take for example:

 

Sin(x) = y

 

It's easy to determine the value of y for any given x, but for a lot of y's there is no answer for x. And when the expression is solvable there are an infinite number of x's that could be valid. You'll run into similar problems with parabolas, hyperbolas, higher order polynomials, you name it.

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Hi David, I can see this is not going to work very well at all. Thanks for taking the time to straighten this out! /Mårten

I would better like a Numeric Slider that has an input like the Loft, or like the Rebuild Curve or like the Mesh Settings, where you can set all the parameters that compose the slider, like the Min and Max limits.

It will help us a lot, think.

 

Andres

Hi Andres,

 

Have you seen the ReMap component?

Although it doesn't handle step sizes.

Thanks a lot Danny. That helps a lot too. It is close to what I want :-)

 

I may change yours to go from 0 to 100 and then divide it by 100!

 

Nice!

 

Andres

Danny, I found two places = GH where I can use your idea! I am happy today.
There's no need to divide by 100. Set up a domain of 0 to 100 and input it into S on the ReMap component

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service