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.
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.
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:
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