Mesh color by vector direction

Hello
Please tell me how to divide the mesh into two colors according to the direction of the vectors? Those directed downwards should be green, those directed uphill should be red.
Thank you.


mesh color.3dm (191.7 KB)
mesh color.gh (10.2 KB)


mesh color_re.gh (18.9 KB)

Check this as well.


mesh color_reV2.gh (23.8 KB)

Interesting solution, thank you


Unfortunately, it does not work with one mesh.
mesh color.3dm (359.7 KB)

If you change the conditions of the problem by yourself, then the code provided not likely gonna work.
It’d be better to modify the code according to the conditions.


mesh color_reV3.gh (106.4 KB)

1 Like

This is brilliant, you have helped me a lot.
Thank you so much