hjweide / pyastar2d

A very simple A* implementation in C++ callable from Python for pathfinding on a two-dimensional grid.
MIT License
150 stars 57 forks source link

Possible to use without python? #17

Closed majimboo closed 3 years ago

majimboo commented 3 years ago

I was wondering how to call this from a C++ app? How to clean it up to remove all python related stuff?

Thank you!

hjweide commented 3 years ago

You could fork the repo and keep only the core implementation from here https://github.com/hjweide/pyastar/blob/master/src/cpp/astar.cpp#L61 to here https://github.com/hjweide/pyastar/blob/master/src/cpp/astar.cpp#L125

You'd obviously have to rewrite the parts that pass in the data and reconstruct the path at the end, because right now they're basically meant to do data marshalling from Python to / from C++.

hjweide commented 3 years ago

Closing, feel free to re-open if you have more questions.