Grasshopper

algorithmic modeling for Rhino

OK, totally dumb noob question here, but I can't remember how to do this...

I want to be able to choose a value inside a domain (slider for now).  What I'm looking for is a component you can hook up a slider to that will vary the value from the start to the end of the domain.

What I've come up with is in the attached image (in this case for uv domains of a surface).  It seems mighty complex to me for a simple function...  Get the domain s/e, subtract start from end to get length, multiply that by a % factor of 0 to 1 and add that to the domain start...  Is there a better way?

Thx,  -- Mitch

Views: 1475

Attachments:

Replies to This Discussion


Not sure if this solves all of your questions, but curves and surfaces can be reparameterized...see the image and let me know if it helps at all...If you do not care about the domain, you can reparameterize to 0-1 in u and v...

you can reparameterize in the surface component or in the surface inputs for the evaluate components by going through the contect menus (and well, many other components which take surfaces might have this option as well)
OOps, replied to the wrong message - mmm... hate forums...
Hey Luis,
Don't you have better things to do with your Sunday...? :-))

Thanks for the reparameterize stuff, I do remember that from scripting etc... I posted this mainly if for some reason I don't want to reparameterize the surfaces, is what I did pretty much the simplest way to do it? I'm sure this has been asked for before, but it might be handy to have a "bounds" slider with input for start/end...

Actually, reviewing the above, I see I'm still thinking in terms of Rhino and not GH... Reparameterizing the surfaces probably won't matter at all anyway, as in this case they're not "real" geometry anyway, just being used for calculation purposes... Anyway, thanks... as usual...! --M
mitch,
if there is some info in the parametrization of the surface, then the way you went about it could work...otherwise, when you don't care about it, then reparameterize will do just fine.
luis
Hi Mitch,

remapping numbers (t) from one domain [a,b] to another [u,v], does involve doing the math:

tm = u + ((t-a) / (b-a)) * (v-u)

or:

tm = u + t * (v-u)

if you are certain that a and b are zero and one respectively. But you've clearly already figured this out.

I'm not sure how much shorter we can make this without specifically adding a domain remapper. I think I probably might as well do that at some point because a lot of people simply aren't equipped to infer the above equations from scratch.

--
David Rutten
david@mcneel.com
Poprad, Slovakia
Thanks guys! - Mitch

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service