{"id":20788781,"url":"https://github.com/liangliangnan/polyfit","last_synced_at":"2025-04-14T22:15:40.483Z","repository":{"id":38374984,"uuid":"98587202","full_name":"LiangliangNan/PolyFit","owner":"LiangliangNan","description":"Polygonal Surface Reconstruction from Point Clouds (C++ \u0026 Python)","archived":false,"fork":false,"pushed_at":"2025-04-04T16:14:49.000Z","size":16605,"stargazers_count":759,"open_issues_count":0,"forks_count":125,"subscribers_count":31,"default_branch":"main","last_synced_at":"2025-04-14T22:15:24.484Z","etag":null,"topics":["hypothesis-and-selection","linear-integer-programming","piecewise-planar-object","primitive-extraction","sharp-feature","surface-reconstruction","urban-modeling","urban-reconstruction"],"latest_commit_sha":null,"homepage":"https://3d.bk.tudelft.nl/liangliang/publications/2017/polyfit/polyfit.html","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LiangliangNan.png","metadata":{"files":{"readme":"ReadMe.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-27T23:20:01.000Z","updated_at":"2025-04-12T07:07:42.000Z","dependencies_parsed_at":"2024-03-11T20:31:48.102Z","dependency_job_id":"a0ae35e6-9663-48d4-845b-de4dd3465257","html_url":"https://github.com/LiangliangNan/PolyFit","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiangliangNan%2FPolyFit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiangliangNan%2FPolyFit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiangliangNan%2FPolyFit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiangliangNan%2FPolyFit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LiangliangNan","download_url":"https://codeload.github.com/LiangliangNan/PolyFit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248968917,"owners_count":21191162,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hypothesis-and-selection","linear-integer-programming","piecewise-planar-object","primitive-extraction","sharp-feature","surface-reconstruction","urban-modeling","urban-reconstruction"],"created_at":"2024-11-17T15:17:02.353Z","updated_at":"2025-04-14T22:15:40.454Z","avatar_url":"https://github.com/LiangliangNan.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"right\"\u003e\n    \u003cb\u003e \u003cimg src=\"https://img.shields.io/badge/Supported%20Platforms-Windows%20%7C%20macOS%20%7C%20Linux-green\" title=\"Supported Platforms\"/\u003e \u003c/b\u003e \u003cbr\u003e\n    \u003cb\u003e \u003cimg src=\"https://img.shields.io/badge/license-GPL-blue\" title=\"license-GPL\"/\u003e \u003c/b\u003e \u003cbr\u003e \u003cbr\u003e\n\u003c/p\u003e\n\n\n# Polygonal surface reconstruction from point clouds \n(implemented with C++ \u0026 with Python bindings)\n\n\n\n![](./images/polyfit.png)\n\u003cp align=\"center\"\u003ePolyFit reconstruction pipeline\u003c/p\u003e\n\nPolyFit implements the hypothesis and selection based surface reconstruction method described in the following [paper](https://3d.bk.tudelft.nl/liangliang/publications/2017/polyfit/polyfit.html):\n```\nLiangliang Nan and Peter Wonka. \nPolyFit: Polygonal Surface Reconstruction from Point Clouds. \nICCV 2017.\n```\n\n---\n\n### Obtaining PolyFit\nPrebuilt executable files and Python bindings (for **macOS**, **Linux**, and **Windows**) are available [here](https://github.com/LiangliangNan/PolyFit/releases). \n  \nYou can also build PolyFit from the source code (Python users see [here](./code/python/README.md)):\n   \n* Clone the repository or download the [source code](https://github.com/LiangliangNan/PolyFit).\n* Dependencies\n  - [Qt](https://www.qt.io) ([v5.14.2](https://download.qt.io/archive/qt/5.14/5.14.2/), \n    [v5.12.12](https://download.qt.io/archive/qt/5.12/5.12.12/), and [v6.7.3](https://www.qt.io/download-qt-installer-oss) \n    have been tested). Qt is required by the [GUI demo](./code/PolyFit). You should still be able to build \n    the [command-line examples](./code/Examples) without Qt. \n  - [CGAL](http://www.cgal.org/index.html) (v6.0, v5.5, v5.0, v4.11.1, and v4.10 were tested).\n   \n* Build PolyFit\n\n  There are many options to build PolyFit. Choose one of the following (not an exhaustive list):\n\n  - Option 1 (purely on the command line): Use CMake to generate Makefiles and then `make` (on Linux/macOS) or `nmake`(on Windows with Microsoft \n  Visual Studio). \n    - On Linux or macOS\n        ```\n        $ cd PolyFit\n        $ mkdir Release\n        $ cd Release\n        $ cmake -DCMAKE_BUILD_TYPE=Release ..\n        $ make\n        ```\n    - On Windows with Microsoft Visual Studio, use the `x64 Native Tools Command Prompt for VS 20XX` (don't use the x86 one), then\n        ```\n        $ cd PolyFit\n        $ mkdir Release\n        $ cd Release\n        $ cmake -G \"NMake Makefiles\" -DCMAKE_BUILD_TYPE=Release ..\n        $ nmake\n        ```\n  \n  - Option 2: Use any IDE that can directly handle CMakeLists files to open the `CMakeLists.txt` in the **root** directory of \n  PolyFit. Then you should have obtained a usable project and just build it. I recommend using \n[CLion](https://www.jetbrains.com/clion/) or [QtCreator](https://www.qt.io/product). For Windows users: your IDE must be set for `x64`.\n  \n  - Option 3: Use CMake-Gui to generate project files for your favorite IDE. Then load the project to your IDE and build it. For Windows users: your IDE must be set for `x64`.\n  \n  Don't have any experience with C/C++ programming? Have a look at [How to build PolyFit step by step](./code/How_to_build.md).\n\n  **News**: Since Aug. 5, 2019, PolyFit is also available in [CGAL](https://www.cgal.org/). Find more [here](https://www.cgal.org/2019/08/05/Polygonal_surface_reconstruction/).\n  \n---\n\n### Run PolyFit\nThis repository includes the following executable programs:\n- [two command-line examples in C++](./code/Examples);\n- [two examples in Python](./code/python/Examples);\n- [a GUI demo](./code/PolyFit), which provides a user interface with a few buttons and screen hints. \n\n\u003cp align=\"center\"\u003e \n     \u003cimg src=\"./images/gui.png\" width=\"600\"\u003e \n\u003c/p\u003e\n\n\n---\n\n### Data\nSome test data can be downloaded from the [project page](https://3d.bk.tudelft.nl/liangliang/publications/2017/polyfit/polyfit.html).\n\nMore information about the data (e.g., data format) is described [here](./data/ReadMe-data.md).\n\n**Plane extraction**. Incorporating plane extraction adds an unnecessary dependency to more third-party libraries (e.g., [RANSAC](http://cg.cs.uni-bonn.de/en/publications/paper-details/schnabel-2007-efficient/)). Besides, it has some randomness (due to the nature of RANSAC) and the data quality can vary a lot (it should be fine if some regions of the planes are missing). So I isolated this part from this demo version and you're expected to provide the planar segments as input. \n\nYou can use [Easy3D's Mapple](https://github.com/LiangliangNan/Easy3D/releases) to extract planes from point clouds. \nAfter you load the point cloud to Mapple, go to the menu 'Point Cloud' -\u003e \"RANSAC primitive extraction', select \"Plane\" as the target primitive type, \ntune the parameters (if needed), and then click the \"Extract\" button. Then the extracted planar primitives will be visualized with each primitive randomly colored. \nYou can save the extracted planes into a file in 'bvg' (**B**inary **V**ertex **G**roup) format. The ASCII 'vg' format also works but is slower. \nPlease note, PolyFit assumes that the model is closed and all necessary planes are provided. \n\n---\n\n### About the solvers\nTwo solvers, namely Gurobi and SCIP (with source code), are provided in PolyFit. \nThe Gurobi solver is more efficient and reliable and should always be your first choice.\nTo use Gurobi, you need to install it and also obtain a license (free for academic use) from \n[here](https://www.gurobi.com/downloads/end-user-license-agreement-academic/). You may also need to modify the path(s) \nto Gurobi in [FindGUROBI.cmake](./code/cmake/FindGUROBI.cmake), for CMake to find Gurobi.\nIn case you want a fast but open-source solver, please try SCIP, which is slower than Gurobi but acceptable. \nThe GLPK and lp_solve solvers (only available in previous PolyFit distributions) can only manage to solve small problems. \nThey are too slow (and thus may not guarantee to succeed). For example the data \"Fig1\", Gurobi takes only 0.02 seconds, while lp_solve 15 minutes. \n\n**Note for Linux users:** You may have to build the Gurobi library (`libgurobi_c++.a`) because the prebuilt one in the original package might NOT be compatible with your compiler. To do so, go to `src/build` and run `make`. Then replace the original `libgurobi_c++.a` (in the `lib` directory) with your generated file.\n      \n### About the timing\nThis demo implementation incorporates a progress logger in the user interface. Thus, running times should be (slightly) longer than those reported in our paper.  \n\n\n---\n\n### Citation\nIf you use the code/program (or part) of PolyFit in scientific work, please cite our paper:\n\n```bibtex\n@inproceedings{nan2017polyfit,\n  title={Polyfit: Polygonal surface reconstruction from point clouds},\n  author={Nan, Liangliang and Wonka, Peter},\n  booktitle={Proceedings of the IEEE International Conference on Computer Vision},\n  pages={2353--2361},\n  year={2017}\n}\n```\n\n---\n\n### License\nThis program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License or (at your option) any later version. The full text of the license can be found in the accompanying LICENSE file.\n\n---\n\nShould you have any questions, comments, or suggestions, please contact me at: \nliangliang.nan@gmail.com\n\n**_Liangliang Nan_**\n\nhttps://3d.bk.tudelft.nl/liangliang/\n\nJuly 18, 2017\n\nCopyright (C) 2017 \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliangliangnan%2Fpolyfit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliangliangnan%2Fpolyfit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliangliangnan%2Fpolyfit/lists"}