vleue / polyanya

Pathfinding using Polyanya
Apache License 2.0
280 stars 20 forks source link

can build mesh from edge lists #38

Closed mockersf closed 1 year ago

mockersf commented 1 year ago

an easier api to create meshes just from a list of edges:

Elabajaba commented 1 year ago

I feel like this might be more useful if the CDT was persisted, and users could modify it to add/remove obstacles.

With that it'd be possible to add a module to bevy_pathmesh that would let users add/remove/modify colliders relatively easily (eg. like https://github.com/TheGrimsey/oxidized_navigation) and performantly, vs having to fully rebuild the triangulation every time a collider is added/moved/otherwise modified.

It'd be nice to eventually get something similar to https://www.jdxdev.com/blog/2021/07/06/rts-pathfinding-2-dynamic-navmesh-with-constrained-delaunay-triangles/

edit: Though of course, doing a triangulation also leaves some pathfinding performance on the table since polyanya can work with ngons.

mockersf commented 1 year ago

Thanks for the link! Lots of interesting info

I'm hoping to make this API nicer to reuse/update, I'm trying to build an interactive demo but didn't have much time lately. Hopefully I should have some soon!

Going from triangles to polygons is possible, there are a few algorithms on how to merge them. My idea is to have pretty much three levels of navmesh:

"slow" and "fast" are very... nebulous for now. On the small example I added (and on my laptop), going from CDT to trimesh takes 140µs and finding a path on that trimesh 8µs