tudelft3d / City3D

Large-scale LoD2 Building Reconstruction from Airborne LiDAR Point Clouds
https://github.com/tudelft3d/City3D
GNU General Public License v3.0
253 stars 41 forks source link

[BUG/Improvement] - Improve resulting 3D models quality #21

Open esgn opened 1 year ago

esgn commented 1 year ago

Bug description

In short

Often the result obj files produced by City3D are valid but not closed and showing face orientation issues.

In details

Me and @LelouchLiBritania are currently testing City3D to try and produce 3D buildings using @IGNF new LIDAR datasets. Our work in progress is available here https://github.com/ignfab/City3D/.
We were successful in producing 3D models with City3D save a small number of cases where reconstruction fails. However we noted that a large of number City3D results were showing face orientations issues. Trying to fix this classic issue with CGAL , we also noted than a large number of these models were also not closed and therefore could not be fixed with PMP::orient_to_bound_a_volume() directly.

How to reproduce and more explanations

I created a minimal repository at https://github.com/esgn/city3d-result-check containing 23_result.obja result from the default City3D dataset produced by CLI_Example_2 with Gurobi, a Python script to fix this result and a CGAL executable to perform the final cleanup and fix faces orientations.

Here is a screenshot of 23_result.obj before fixing or cleanup showing all the faces but the floor incorrectly oriented :

image

Trying to fix 23_result.obj directly with CGAL make the following issues apparent :

Here is an example of what CGAL detects as self intersecting faces :

image

Inspecting these self intersecting faces it appears most of them are caused by a vertex of a wall face missing from an edge of the floor face. To say it in a different way, it is as if the floor face was added at the end of the reconstruction process without adding the necessary vertices lying at the bottom of the wall faces. Note that these self intersecting faces can sometimes occur between wall faces or between wall face and roof face but these cases are less prevalent.

Adding the missing vertices is exactly what the Python script provided in the repository does. Having added the missing vertices, the CGAL executable works without error and produces a clean 3D model with faces correctly oriented as shown below

image

My question : Would it be possible to improve City3D so that the produced models are directly closed and correctly oriented so that we could skip this post processing phase ?

Note that we are also trying an alternative approach using CGAL alpha wrapper and edge collapse to fix this same issue and to also merge co-planar faces while we are it.

Development/Running environment:

Thanks in advance,

LiangliangNan commented 1 year ago

@yidahuang I think this can be easily solved by taking advantage of the known orientation of walls, thereby automatically stitching the faces to form closed models. How is this going?