Jump to content
X0RD

Custom edge cost at find shortest path

Recommended Posts

Hello everybody, 

Im looking into the "find shortest path" node to create road like the image below;

44c79bd3hc5558f7069ea690.jpg

And now i have find a particular piece of text in the help of "find shortest path" node that could help me creating it;

"For example, you could penalize edges with steep slopes."

This would require using "Custom Edge Cost" and expression, that you also can find in the "find shortest path" help as wel (in the bottom). 

Now I have tried multiple expressions, but it only once that works for me are the $ + expression with unwanted results and no divination of how steep a slope can be.  

If somebody could help me out, that would be great. :) 

Share this post


Link to post
Share on other sites

In general I would try to avoid the usage of H-expressions, and would use primitive cost attributes to guide your pathfinder.
To make best use of this, you want your input grid to be open primitives (one primitive for every connection, rather than a normal quad grid)
but once you have that, you can combine however many constraints into this cost attribute, using wrangles for instance.

Another approach you could use is using the surface primitives/ edges to avoid, in the third tab, to (un)group connections that are too steep. 

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×