Grasshopper

algorithmic modeling for Rhino

Help with colour gradient? Can it follow a curve?

Hey everyone


Hoping someone could enlighten me with much knowledge regarding colour gradients.


I have these ramp-like objects and I'm currently using modelab tools' bakematerial component to get the colours. These are currently working with an attractor. Image and definition:



So how can I get the gradient to work on the ramps? Or would I have to use a curve and somehow tell it to follow the curve? The gradient seems to work on other objects.


Grasshopper and rhino file attached below if anyone wants to have a look!


Thanks in advance!


Ra.

Views: 5567

Attachments:

Replies to This Discussion

Hi Ra,

You can only assign a single colour to a NURBS surface, you need to create a mesh and colour each vertex in order to achieve a gradient. Decompose a Mesh to get the vertices to measure you distance against and then plug the gradient into the Mesh Colours Component. Also Meshes will bake with their colour attributes intact.

Here's something to get you started. Note you might have difficulty with managing multiple BReps

Thanks Danny!

I was wondering though, have you tried plugging it back into bakedmaterials (a component from modelab tools)? For some strange reason, it keeps baking 288 copied on the layer i chose.
I don't have modelab tools, sorry.
No problemo!

Thanks for the mesh definition anyway!
Hey Danny,

I tried baking the mesh colour component. But when I tried rendering, the colour didn't show up!

Is there a way of fixing this?

Also can I get a gradient to follow a curve?

Sorry that I have many questions!
I thought this might come up, (about the curve) here's my solution for working out the distance along the curve, for this example I've used a dupedge from rhino as the referenced curve.

MeshColourCurve.png
What renderer are you using?
Instead of the Preview component use the modolab tool. This works with multiple BReps referenced at the beginning.
Attachments:
Thanks! Sorry, for some strange reason, I didn't get an email notification for your reply!

I'll have a go at it!

I somehow miraculously figured out how to do gradients according to heights!

Oh and I'm using Vray. I tried hooking it back to the modelab tool but i don't think it worked. Tried rendering it and it became all fuzzy.
Sorry Danny, I have another query.

I have some objects(columns/balustrades) that run along the ramps. I tried plugging those breps into the function you did earlier where the gradient follows the curve. For some strange reason, it didn't work.

Here's an image:

shouldn't you be in bed by now!

can you post your latest 3dm model and ghx?
(for some strange reason, I couldn't reply below)

My sleep averages to about 3 hours a night really. You can see how my brain is dead!

Here are the files below! I also found a simpler way to do the gradient according to height.

Even if we figure it out, I still can't find a way to render it with colours :(
Attachments:
I think your brain is toast. The easy answer is you are plugging in curves and the two ramps to the Mesh from BRep component. Not the intended geometry from your earlier efforts. But also unplug the mesh settings component as this level of detail might be causing the component to error as well.

Good luck

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