Grasshopper Terrain Slope in Degrees

Hey Guys,

Thank you for your replies. Here is what I came up with. Basically based of what David suggested.
I like Chanley’s variant as well.

Cheers


SlopeAnalysisPercent.gh (1.4 MB)

1 Like

Hi Chris, thank you so much for this script.

I got a question regarding the slope ranges. (0 to 10, 10 to 20, etc.)

I am able to follow till where you converted the Tangent to Percentage. I understood you are using Find Domain to check which group the Slope Percentage falls into. Is the slope range is to be thought of as percentage?

I am trying to design a walkable slope.
It seems my slope range will be quite small. For example, 0 to 5 for 1in20 ramp (5%).
Am I understanding correctly?

Thanks!
Mon

In the example that I showed above, the logic is as follows:
1 - the values being computed are actually “done” once they come out of the “Angle - compute angle between 2 vectors component”. They are output in Radians. The rest is just sorting/organizing data to color mesh faces.
2 - the next step is converting those radians to either “Degrees” or “Percent”. In Landscape Architecture, (the discipline I work in), we almost always use percent. The “Stream Filter” component is being used to select which one you want to use.
3 - The Slope “ranges” that you want to find, (that are defined in the “Gene Pool” component"), are not necessarily dependent on whether you use Degrees or Percent. It is simply being use to define the bounds of the domains you want to be searched. The values are set manually according to what you want.

So, in my example in the screen shot above, the values coming out of the “Angle” component are being converted to Percent. So the values are in percentages. The find domain doesn’t care what “units” the values are in, it just takes the values that are between, for example, 0 -10, and puts them all in that domain. So the values, that are already computed as percent, are put in “0-10”. If you changed the input of the stream gate to “Degrees”, and didn’t change anything else, the “0-10” range would hold values of 0-10 degrees. Note: as you already know, percent is not the same as degrees, and the coloring of the mesh will be different based on your choice.

Hrmm, not sure I explained that clearly. …

Lastly, that mesh explode component in my example is old and totally overkill. You can simply put this into a python component: Set the input to Item Access, Type Hint = Mesh, Change the Name to M. Change the name of output to F

import Rhino

if M:
    M.Unweld(0, True)
    F = M.ExplodeAtUnweldedEdges()
1 Like