Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
esgn opened this issue May 3, 2023 · 1 comment
Open

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

esgn opened this issue May 3, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@esgn
Copy link

esgn commented May 3, 2023

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 :

  • The model could not be closed
  • The model showed self intersecting faces

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:

  • OS: Debian 11
  • Compiler GCC 10.2
  • Release with Gurobi 9.5.2

Thanks in advance,

@esgn esgn added the bug Something isn't working label May 3, 2023
@LiangliangNan
Copy link
Member

@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?

@LiangliangNan LiangliangNan added enhancement New feature or request and removed bug Something isn't working labels Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants