Jump to content

Custom edge cost at find shortest path


X0RD

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

Link to comment
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 2
Link to comment
Share on other sites

  • 2 weeks later...
  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...