QGIS icon indicating copy to clipboard operation
QGIS copied to clipboard

Exporting a 3D scene results in a broken obj file

Open AbdelghaniTamort opened this issue 9 months ago • 2 comments

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

  • [x] I'm running a supported QGIS version according to the roadmap.

New profile

Additional context

No response

AbdelghaniTamort avatar May 15 '24 09:05 AbdelghaniTamort

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

ptitjano avatar May 15 '24 10:05 ptitjano

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

AbdelghaniTamort avatar May 15 '24 11:05 AbdelghaniTamort

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

AbdelghaniTamort avatar May 31 '24 08:05 AbdelghaniTamort

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

What's the issue on 3.36.1 then ?

AbdelghaniTamort avatar Jun 05 '24 09:06 AbdelghaniTamort

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

ptitjano avatar Jun 05 '24 10:06 ptitjano

Appreciated !

AbdelghaniTamort avatar Jun 05 '24 11:06 AbdelghaniTamort

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

NearDuckyu avatar Jun 10 '24 01:06 NearDuckyu

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.

ptitjano avatar Jun 10 '24 07:06 ptitjano

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.

NearDuckyu avatar Jun 10 '24 08:06 NearDuckyu

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

AbdelghaniTamort avatar Jun 10 '24 08:06 AbdelghaniTamort

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

AbdelghaniTamort avatar Jun 21 '24 09:06 AbdelghaniTamort

Hi, is this still broken? I get some weird output on 3.38

image

eried avatar Aug 22 '24 10:08 eried

tested in 3.30 = works fine :)

eried avatar Aug 22 '24 11:08 eried

some more feedback, it seems when the terrain resolution goes higher, the model starts to break, this is at 1500: image

At 4096 the file is corrupted. Around 500 works ok

eried avatar Aug 22 '24 11:08 eried

This is not fixed for me in 3.38.3 1 2 3

Laz file I created the mesh with Export to raster (triangulation) and I want to import that in blender.

Nekzuris avatar Oct 27 '24 17:10 Nekzuris

@Nekzuris , please try if the issue occurs also using QGIS 3.40.

agiudiceandrea avatar Oct 28 '24 06:10 agiudiceandrea

Well I tried but the installer failed, it says I'm missing: libssl-1_1-x64.dll, libcrypto-1_1-x64.dll and qssapi64.dll I tried reinstalling it but same errors. Why 3.40 isn't there? https://download.osgeo.org/qgis/windows/weekly/?C=M&O=D

Nekzuris avatar Oct 28 '24 23:10 Nekzuris

Okay it works now, but only with a DEM. I tried simply with the Render as a Surface (Triangulate) option but it result in an empty file.

Nekzuris avatar Oct 29 '24 19:10 Nekzuris

@Nekzuris, I think it would be more useful if you created a new issue report providing all the requested info and a project and layer(s) and parameters and step by step instruction in order to replicate the issue.

agiudiceandrea avatar Oct 30 '24 12:10 agiudiceandrea