Need help in slope analysis and colour coding

Recently from a youtube tutorial, I learnt how to do colour grading based on steepness of the slope. I am attaching the script that I made step-by-step.

However, I’m unable to figure out how I can designate specific colours like the following.

Slopes upto 10% - Colour 1
Slopes greater than 10% upto 20% - Colour 2
Slopes greater than 20% upto 30% - Colour 3
Slopes greater than 30% upto 40% - Colour 4
Slopes greater than 40% upto 50% - Colour 5

terrainmoddy.gh (8.5 KB)

Please provide help.

Here is an example of one approach.

1 Like

Unless your goal is to learn by setting up your own definition you could also check out the Bison plug-in.

1 Like

Thanks! I’ll try this plugin and get back to you.

Thanks for sharing this link. I’ll try all the methods and get back here on this post to share my experience…

No problem. Also, the custom “explode mesh” component in that example is kind of overkill. You can make your own ghpython component using the following: (input M type hint set to Mesh)

import Rhino
M.Unweld(0, True)
a = M.ExplodeAtUnweldedEdges()

How do I give specific colours for specific slope percentage sets?

Bison seriously looks the best option instead of the one long script that I posted in the original post.

e.g. 0-10% green
10-20% is blue
20-30% is dark blue, so on and so forth?