MeshPolygonization is the implementation of the MVS (Multi-view Stereo) building mesh simplification method described in the following paper:
Vasileios Bouzas, Hugo Ledoux, and Liangliang Nan.
Structure-aware Building Mesh Polygonization.
ISPRS Journal of Photogrammetry and Remote Sensing. 167(2020), 432-442, 2020.
Please consider citing the above paper if you use the code/program (or part of it).
The main characteristic of this method is structure awareness โ namely, the recovery and preservation, for the input mesh, of both its primitives and the interrelationships between them (their configuration in 3D space). This awareness asserts that the resulting mesh closely follows the original and at the same time, dictates the geometric operations needed for its construction in the first place โ thus providing accuracy, along with computational efficiency.
The proposed methodology consists of three main stages: (a) extracting planar primitives via mesh segmentation, (b) encoding primitive interrelationships in a structure graph, and (c) mesh polygonization. In particular, polygonization is accomplished here by approximating the primitive borders with a building scaffold, out of which a set of candidate faces is defined. The selection of faces from the candidate set to form the simplified mesh is achieved through a linear binary programming formulation, in which certain hard constraints are enforced to ensure that the result is manifold and watertight.
This repository is structured as follows:
- The data directory stores some mesh models of urban buildings. The results will also be written into this directory by default.
- The src directory contains the source code.
MeshPolygonization depends on CGAL. Please make sure CGAL exists on your machine before you build the program. During the development of MeshPolygonization, CGAL v4.13 was used, and later CGAL v5.1 has also been tested. Newer versions should also work.
To build MeshPolygonization, you need CMake (>= 3.1
) and of course a compiler
that supports C++11 (or higher)
.
MeshPolygonization has been tested on macOS (Xcode >= 8), Windows (MSVC >=2015), and Linux (GCC >= 4.8, Clang >= 3.3). Machines nowadays typically provide higher supports, so you should be able to build MeshPolygonization on almost all platforms.
There are many options to build MeshPolygonization. Choose one of the following (or whatever you are familiar with):
- Option 1: Use any IDE (e.g., CLion or
QtCreator) that can directly handle CMakeLists files to open
the
CMakeLists.txt
file in the root directory. Then you should have obtained a usable project and just build it. - Option 2: Use CMake to generate project files for your IDE. Then load the project to your IDE and build it.
- Option 3: Use CMake to generate Makefiles and then
make
(on Linux/macOS) ornmake
(on Windows with Microsoft Visual Studio).
Don't have any experience with C/C++ programming? Have a look at How to build MeshPolygonization step by step.