qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.09k stars 2.93k forks source link

Exporting a 3D scene results in a broken obj file #57437

Open AbdelghaniTamort opened 2 months ago

AbdelghaniTamort commented 2 months ago

What is the bug or the crash?

The native export 3d scene feature of QGIS results in a broken 3d model (distorted terrain and extruded buildings) when displaying it in Blender or MeshLab.

For instance, the following scene looks like this in the 3d view : image

When displaying the exported version of it in Blender it looks like this: image

The terrain has been distorted and some of the buildings have missing pieces.

Steps to reproduce the issue

  1. Choosing a raster DEM as terrain
  2. Choosing a vector layer to use as extruded buildings
  3. Exporting the scene using the export option in the 3d view : image
  4. Displaying the exported 3d scene in a 3d visualization software

Versions

Version de QGIS 3.36.1-Maidenhead Révision du code 3e589453 Version de Qt 5.15.3 Version de Python 3.9.18 Version de GDAL/OGR 3.8.4 Version de Proj 9.3.1 Version de la base de données du registre EPSG v10.098 (2023-11-24) Version de GEOS 3.12.1-CAPI-1.18.1 Version de SQLite 3.41.1 Version de PDAL 2.6.0 Version du client PostgreSQL 16.2 Version de SpatiaLite 5.1.0 Version de QWT 6.1.6 Version de QScintilla2 2.13.4 Version de l'OS Windows 10 Version 2009

Extensions Python actives BoundingBox 2.1 citygen 0.3 firstaid 3.1.0 idg 0.2.4 landxmlconvertor 0.2.0 model_generator_opendata 0.1 pluginbuilder3 3.2.1 plugin_reloader 0.9.4 qgis-maptiler-plugin 3.3 Qgis2threejs 2.7.3 quick_map_services 0.19.34 STL_Generator 1.0.0 valuetool 3.0.19 db_manager 0.1.20 grassprovider 2.12.99 MetaSearch 0.3.6 processing 2.12.99

Supported QGIS version

New profile

Additional context

No response

ptitjano commented 2 months ago

@AbdelghaniTamort Thanks for the report and the detailed information. Could you please share your data and your QGIS project?

AbdelghaniTamort commented 2 months ago

Sure, here goes : Qgis 3d export issue.zip

AbdelghaniTamort commented 1 month ago

@ptitjano any news on the issue? is it really a QGIS bug or an error related to the data I was using ?

AbdelghaniTamort commented 1 month ago

update, the export tool is working fine in version 3.30: image

What's the issue on 3.36.1 then ?

ptitjano commented 1 month ago

@AbdelghaniTamort I will try to take a look at it next week.

AbdelghaniTamort commented 1 month ago

Appreciated !

NearDuckyu commented 1 month ago

@AbdelghaniTamort Thank you for sharing your trial. Exactly same issue has been occured to me and it works well with version 3.30 as you mentioned.

ptitjano commented 1 month ago

I have taken a look at it. It turns out this is a regression caused by https://github.com/qgis/QGIS/pull/52064 which fixed an other issue: https://github.com/qgis/QGIS/issues/50971

I have tried to solve it but this is not an easy task. I discussed it with @benoitdm-oslandia . He has not found any solution at the moment but he will try to take a look it when available. I cannot make any promise at the moment.

NearDuckyu commented 1 month ago

Just to let you know, I've tried the export task with version 3.34 too. It results in a broken OBJ file just as version 3.36 does.

AbdelghaniTamort commented 1 month ago

@NearDuckyu thank you for taking the time to test it out! @ptitjano @benoitdm-oslandia understood, thank you in advance!

AbdelghaniTamort commented 3 weeks ago

could I request something for when issue will be treated ? Can the output obj file be georeferenced in the same crs as the terrain?