A path with slopes on the terrain

Hі!
Now I’m looking for a way from point A to B with a maximum gradient of 10%. I currently have a script I found on the internet, but it doesn’t work the way I’d like it to.
Please look at the working files and give comments on how to improve the result.


Way on terrain.3dm (6.8 MB)
Скрипт побудови дороги з ухилом на рельєфі.gh (36.4 KB)

This is an example of who, what result I would like to get.
https://www.instagram.com/p/CAZ5rB3JH58/

1 Like

This topic has a couple of different approaches:

As I recall there is another topic implementing Kangaroo, maybe have a search.

I used your script but it didn’t quite work for me. It creates large slopes, more than 10% Can it be painted?

Try turning the smoothing off. This will likely yield a much more jagged path, which may be helped by using a denser terrain mesh graph.


This is better, but there are still places where the slope exceeds 10%

As I said, you’d likely need a denser mesh. But in your case, an agent-based or relaxation method is likely more appropriate, as this is independent of an underlying graph/path network and can be steered more intentionally.

Edit: But try uploading your files and I’ll have a look when I the chance.

unfortunately, I don’t know how to write code, so I’m unlikely to be able to use this method you write about.

The source files are in the first post.

I meant the one implementing my old networkx script. But either way, it’s probably not suited for your case since it minimises the cost of the total path (i.e. not locally caring whether a path segment is above 10%). One might fiddle with the weights when constructing the graph (e.g. make anything with a slope above a max incline be super expensive, or simply skip these edges entirely). But this would still be very sensitive to the discretisation of the terrain (i.e. density, quads/tris, operating on the faces or edges), as seen here:






2304281_LeastSteepMeshPath_00.gh (72.1 KB)

I found this script. But I still don’t know if it will work for me

Just tried this and it kinda works. It’s of course still very sensitive to discretisation and note that I’m computing the slope as the edge angle away from flat (see the lineSlope function in the screenshots) and that operating on a vertex graph yield less steep edges (i.e. the face graph becomes disconnected and thus no path exists connecting the destinations). Anywho, some things to consider for you :slight_smile:




2304281_LeastSteepMeshPath_01.gh (71.3 KB)

1 Like

That looks very similar to the agent-based view-cone/stepping logic I was suggesting above. Hope it works for you.

Thanks, I’ll try these two build methods and let you know if they work for me.

check out this nice post from Daniel Piker:

1 Like