Grasshopper

algorithmic modeling for Rhino

I hope you're familiar with the "there are no stupid questions" saying...


I'm trying out a simple definition which maps a bitmap to a surface. It worked fine on one, and then when i created a simple 2 corner rectangular surface, it seemed like my bitmap was tiled some 20 times on the surface. Indeed, the UV output of the divide node did show numbers much higher than 1.0.

I've tried rebuilding the surface with more than just 2x2 uv segments, but it was still the same. When i rebuilt it the second time, back to 2x2, the UVs returned to range 0.0-1.0.

Is this a bug, or am i again missing out on something fundamental? Why is this occurring and is there a way to normalize it parametrically to 0-1?

Views: 637

Replies to This Discussion

The domain of a surface (or a curve for that matter) is really a set of arbitrary numbers that represent its "length" mathematically. When you make a curve or surface, the natural parameterization tends to align with the real world scale of the object, hence the reason you're finding it much larger than it was before. In you're case you want to fit values from 0 to 1 to this arbitrary domain and there are two options to do so. The first (and slightly more complicated) is to extract the current domain of the surface and, with a little algebra, remap those 0->1 values to the size of the domain. The second (an much easier) method is to just reparameterize the surface, which will automatically set the domain of the surface in both directions to 0->1, thus having the image values automatically map onto the surface. Just pass the surface through a Surface parameter, and then right click on it and choose Reparameterize.
Thank you. Reparameterize will do for now. I only saw one example with surface domains (i'm not sure what it is) but the simple algebra you are referring to, could it be something along the line of findinng the largest number in U and largest number in V (right now i do not understand if they can be different) and dividing the target domain with it?

As far as i understand if i have a domain of 0-3, mapping an image to the surface, would tile it 3 times in that direction,
There's no longer an actual surface domain component (there used to be many versions back). However, if you feed a surface into the Decompose 2d Interval, that will give you mins and maxes of the U and V intervals. Assuming that you're working off of a 0->1 value that you'd like to make fit whatever the domain might be you'd use the following formula...

min + ((max-min)*val)

Again, surface domains are a very abstract and very arbitrary expression of the surface. It doesn't really have all that much of a visual component, and since you can reexpress the domain to any minimum and maximum value you want, the actual values (more or less) are insignificant.

To you're last point, you are correct.
Thank you. When reparametrize is activated on the surface component, it keeps bringing the surface into the domain? I also did not realize that there was a reparametrize command in rhino itself, (took me a while to find it), i guess i can use it to tile the controlling image as many times as i want.

Why was the component removed? It seems like it could be useful. But it could be recreated by the formula you wrote above, and then multiplying it with a floating number.
The component was removed because of "implicit conversion", which basically means that if you use an input that isn't exactly what a component needs, it will do its best to convert that into the type of data that is needed to do its task. Since David added the ability to handle the extraction of a surface domain directly from a surface when plugged into an interval component, the actual component itself was deamed unnecessary.

As to you're first statement..."bringing the surface into the domain"...the domain can be thought of as the mathematical length of the surface, so its always there. Its just a matter of whether that domain lies within a usable range or not.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service