Grasshopper

algorithmic modeling for Rhino

Coloring NURBS Surface According to Values at Control Points

Hey all,

I can't decide if there's a simple way to do this that I'm just not thinking of or not, but I can't wrap my mind around it so I figured it bring it to the community.

What I'd like to be able to do is have the color of a surface vary according to additional information that would be found on each control point of the surface. For example, in addition to the xyz coordinates of each control point imagine if we had a 4th value (let's call it "temperature" here). This temperature value would be subject to the same recursive NURBS functions as the control points themselves, and their colors would be combined accordingly and visualized on the surface over the same parametric space.

Does that seem possible in Grasshopper as such? Is further explanation needed? I'm totally up for scripting if that's what it would take.

Thanks,

Austin

Views: 831

Replies to This Discussion

Why not use a mesh whose vertices are the control points??

Nurbs surfaces have no members about color.

Ah, I should have mentioned--I am aware that using meshes is generally the way to do this :). Definitely a good solution though, and I hadn't specifically thought about using a mesh whose vertices are control points so maybe I'll play around with that some.

However, am I correct in assuming then that the color would vary linearly from vertex to vertex? It would be great for it to vary according to the "curvature" of the nurbs surface, if that makes sense, hence the original question...

Yes, for coloring a mesh you give a color to each vertex. I hope this helps you get what you want.

Attachments:
#meshes

Haha yes yes I know. Meshes would be the usual way to do this. But is it possible more in the way I've described? Here's what I think would be the problem (albeit a small one) with meshes...

When a mesh is colored from one vertex to the next, my understanding is that the color gradient is completely linear. i.e. if vertices 1 and 2 are red while vertices 3 and 4 are blue we'll get a nice smooth transition from red to blue, varying linearly with the mesh space, regardless of the underlying NURBs structure.

What I'd prefer is the "color values" at each control point to be evaluated using the same formula that is used to create NURBs surfaces in the first place (the Cox-De Boor recursion formula) such that the color variation matches the variation of the curvature. So if, in the previous example, the slope of vertices 1 and 2 is very steep but then quickly flattens to a longer area before reaching vertices 3 and 4, then the color change would be more drastic near the first 2 vertices. (I think...my understanding of slope's relation to color feels a bit hazy here...)

Hopefully that makes sense. I'm not exactly looking for a solution here, more of just a "Yes, somebody has done this before" or "No you definitely can't do that" or "This seems really strange, but you probably could do it!" Any insight would be welcome :)

Yes, with meshes!!!! Seriously, just pass curvature values and color them how you wish, linearly, non-linearly, up to you. You can mess with the color gradient to best represent the domain of curvature you use. Them pass that to a mesh that appropriately represents the surface...

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