Color gradient equal to surface degrees

Hello!

I want to design a path on a slope and I would like to create a custom preview of gradient colour equal to the path degrees in order to create a diagram showing that the degrees of the path is between 0% - 12 %.

Is it possible to create it in grasshopper? How difficult is it? This is a part of the path I want to create!

path.gh (10.1 KB)

I would appreciate if you could suggest me a reference tutorial or anything that could help me!

Thanks in advance!

There are a few discussions on various methods for doing slope analysis. Here is one that has a few different flavors, (C#, Python, Native components).

Thank you Chris!

What exactly are the numbers at gene pool ?

The examples in that thread with the gene pool component are using it to set various “slope ranges”.
so a gene pool with values of:
1
4
8
14
21
30
is fed into something like a consecutive domains component/function, to yield “ranges”:
1-4
4-8
8-14
14-21
21-30

(ranges is a poor choice of words on my part, they are explicitly DOMAINS…that are used to hold the slope values that fit into those domains).

And these domains are degrees (units), radians or they mean something else? Cause all my surface points gets pink.

Another consideration is that some parts of your path are canted sideways - are you looking for the slope along the direction of the path or in two dimensions?

see illustration - red arrows are the normals of surface and black lines are vertical

Yeah Qythium thank you for your comment. The fact that some parts are canted sideways is something that i haven’t fixed yet. So the correct case is with only vertical normals so I don’t care for two dimensions.

In that case, the link posted above isn’t so applicable- instead try extracting the center isocurve of your surface and use that to get directional derivatives.

path.gh (23.3 KB)


Thanks a lot qythium!! It works perfect!

In the examples I referenced, the base geometry was mesh faces. The units that come out of vector compare, (measure angle between two vectors), outputs radians. Those are then converted to degrees, (using the built in radians to degrees component). There is then an option to use degrees or Percent.
Looks like you have a working solution already.