CGAL region growing algorithm for plane detection.
- CGAL 5.0 or higher.
- Boost: math, filesystem, program options. Project was tested with Boost 1.71.
- CMake 3.20 or higher.
- Optional. VTK. It need only for visualization.
- Compiler with support C++14.
- Ninja (for Linux).
- Visual Studio 16 (for Windows).
See GitHub Action for compilation from source
cmake --preset linux-ninja
cmake --build ./build --config Release
See GitHub Action for compilation from source
Unzip GMP and MPFR libraries. Set env variable GMP_DIR
, MPFR_DIR
to the <a path to GMP from archive>/auxiliary
Run CMake (PowerShell):
$env:GMP_DIR = "<a path to GMP from archive>/auxiliary"
$env:MPFR_DIR = "<a path to GMP from archive>/auxiliary"
cmake --preset windows-vc16 -DCGAL_DIR:PATH="<a path to CGAL directory from archive/lib/cmake/CGAL"
cmake --build ./build --config Release
Find executable (for Windows):
.\cgal-plane-detection.exe -i input_mes.obj -o segmented.ply -c
Results are three files:
- Segmented mesh
segmented.ply
. - Bounding planes in the
segmented-planes.ply
as mesh. - Coordinates of bounding planes in the
segmented-planes.txt
.
You can download example from Sketchfab.
See --help
for additional parameters
Some parameters are described here
Argument -d
allow to see results (if you compile with VTK).
For best result you need axis aligned model.