Picking colours according to slope heights

Hi guys, I am new to grasshopper and was trying to pick colours from the slope heights individually, but haven’t had any luck in making it work, since it picks all the colours together in every time. Is there a way to make it pick the colours individually?.

Trial 2.gh (56.5 KB)

missing


Trial 2_2023Sep16a.gh (64.2 KB)

P.S.


Trial 2_2023Sep16b.gh (66.2 KB)

1 Like

Is there a way to take each of the colors out from this? like blue separate, yellow separate etc.
Thank you for replying.

Separate how? It’s a gradient, there are many colors… Version ‘a’ or version ‘b’?

I wanted the colours to be separated according to the slope heights, if it was possible. So if the range of the colours is 6-10 in the case of the script before, It takes out green colour from it. Is it possible to project the value of the slope z points to the colours and put a range to take out the colours from it?


Many things are possible. Why are you discussing “slope”? The Z values are heights, not slope angles.

I don’t have your plugins so don’t know what they are doing.

1 Like

The plugin is called ‘Bison’ which in this case is making a slope map from the mesh. The Z values are heights yes, but I wanted to know if there was some way to make the colours out according to those Z values, so if there is a Z value in a certain range, it only takes out the colour green from the mesh.
Sorry, I have just started with grasshopper and thank you for responding.

plugin: Bison | Food4Rhino

I know where to find plugins, I just don’t want to install it. There are ways to do without it but maybe it would be better if someone else helps you who has the plugin or is willing to install it.

Okay. Thank you for the help :+1:

I don’t know if this is correct?


Trial 2_2023Sep16c.gh (68.0 KB)

8 instead of 16 divisions:

Can the cells be selected according to one color?. Like for green, only green cells are selected etc.

Yes. But it’s not clear to me what kind of UI (user interface) you want. If you understand the code, many things are possible!

I want to just separate the colors using dispatch or some other component and get the cells in one color separately. The issue I was facing was that I couldn’t get single colors cells separate.

Yeah, I’m a little distracted and apparently you know very little about GH so… good luck and good night.

Slider in the purple group selects a domain / color:


Trial 2_2023Sep16d.gh (72.4 KB)

1 Like

Thank you for the help and good night.

I’ve made a few small changes. Whatever it is you want to do, I’m sure you can do it without a plugin if you understand this code.

  • Used QRMesh (Quad Remesh) instead of Mesh UV. Produces mesh faces aligned with the original surface instead of aligned diagonally (with the untrimmed surface UV curves).

  • Replaced the fixed value ‘16’ with a ‘NumColors’ slider (blue group) to adjust color “resolution”.

  • Added a ‘All or One’ Value List (yellow group) to switch between showing all colors or just the one selected with the ‘Index’ slider in the purple group.


Trial 2_2023Sep17a.gh (72.0 KB)

NOTE: I am converting mesh faces to EdgeSrf fragments because I don’t know how to color mesh faces - maybe someone else does?

4 Likes

Yes!!! this works pefectly. Thank you so much for all the help :pray: :pray:

I just updated this code in another thread (explained there) to avoid using EdgeSrf:


Trial 2_2023Sep21a.gh (67.5 KB) (UPDATED below)

P.S. I found a component to get face centroids directly instead of using the average of face boundary discontinuity points. The result appears to be identical though, so I don’t know why a few faces have different colors (Z values) from the Sep17a version using EdgeSrf.


Trial 2_2023Sep22a.gh (71.1 KB) (UPDATED below)

Face Normals ‘C’ output (FaceN) in cyan group.

P.P.S. Not that it matters in this case but I added a fix internal to the CMesh cluster to correctly handle multiple meshes in a data tree. I’ll replace two earlier versions in this post with this one:
Trial 2_2023Sep24a.gh (70.4 KB)

A demo of multiple meshes in a data tree:
cmesh_demo_2023Sep24a.gh (27.7 KB)

2 Likes