PathFinding.js icon indicating copy to clipboard operation
PathFinding.js copied to clipboard

Padding around unwalkables

Open ForgeableSum opened this issue 10 years ago • 3 comments

Is there any way to create a sort of padding around unwalkables? So that the path will be the quickest route while keeping an x amount of distance from unwalkables at all times?

ForgeableSum avatar Jan 15 '15 02:01 ForgeableSum

Cost is what you want, and it's currently not supported by the main branch. There's a fork that supports it though https://github.com/johnste/PathFinding.js

rohan-deshpande avatar Jan 15 '15 02:01 rohan-deshpande

Excellant! Is there a readme which explains the costs option or is it just as simple as adding it like this: var finder = new PF.AStarFinder({ allowDiagonal: true, dontCrossCorners: true, cost: 5 });

I don't see anything different in the docs on that fork but maybe I'm missing something.

ForgeableSum avatar Jan 15 '15 15:01 ForgeableSum

The link doesn't work anymore, has anyone found a way of doing this?

lafkpages avatar Sep 15 '22 16:09 lafkpages