Cppvisgraph is a MIT-licensed Cpp library for building visibility graphs from a list of simple obstacle polygons. The visibility graph algorithm (D.T. Lee) runs in O(n^2 log n) time. The shortest path is found using Djikstra's algorithm. This is a C++ translation of the library pyvisgraph.
Though this is a header only library, And dependencies for building is nothing but C++ Standard Library. However, to build python wrapper, pybind11 is required. Check if it already exists or not with the following command.
python3 -c "import pybind11; print(pybind11.__version__)"
.
- C++ 11
- CMAKE Ver. 3.10.0
- Python 3
- pybind11 Ver. 2.10.4
- Can directly be used in any cpp projects.
- Can also be used in python projects with the advantage of faster execution time.
Follow the examples written in vgexamples.cpp
or vgexamples.py
files under examples
directory.
Copy the src/cppvisgraph
dir to your project directory and use accordingly.
Copy the build
dir to your project directory and use accordingly.
Make sure pybind11 is installed. If not, install with the following command.
pip install pybind11
Navigate to the project dir and execute.
./build.sh
Grant permission if necessary.
chmod -R 777 .
If the Build was successfull, the examples should run.
c++
./build/vgexample
python
python3 examples/vgexamples.py