Mesh color by vector direction

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 (10.2 KB)

mesh (18.9 KB)

Check this as well.

mesh (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 (106.4 KB)

1 Like

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