This is a wrapper of CGAL using Eigen data type. Currently supporting:
- Triangle to triangle collision detection between two meshes.
- Ray-tracing on a mesh.
If installing to home folder, add
-DCMAKE_INSTALL_PREFIX=$HOME
to every cmake command.
Eigen : Eigen should come with Ubuntu 18.04.
CGAL: The library that does the actual work.
The installation of CGAL can be nasty. The following procedure should work.
If you miss any dependency, this document is a good reference(though it is for an older version) Note you don't have to install QT. It is only useful for visualization with CGAL, which we don't need for now.
- Download the CGAL release from here, scroll down to
CGAL-4.1, click to unfoldAssets, downloadCGAL-4.14.tar.xz. - Unzip the file.
- Install dependencies:
sudo apt-get install libboost-all-dev
sudo apt-get install libgmp-dev
sudo apt-get install libmpfr-dev- Build and install:
cd CGAL-4.14
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make
sudo make install
You might need to install mpfr from source. First, download it from https://ftp.gnu.org/gnu/mpfr/ (e.g. mpfr-4.1.0.zip), then
unzip mpfr-4.1.0.zip
cd mpfr-4.1.0
./configure
make
sudo make install
Now you have all the dependencies, go back to this folder and:
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make
sudo make install
Notes
- Currently only supports .off file type.