minorua / Qgis2threejs

3D map visualization and web export plugin for QGIS
http://minorua.github.io/Qgis2threejs/docs/
507 stars 92 forks source link

Python error when exporting #267

Open hollubaun opened 2 years ago

hollubaun commented 2 years ago

I am getting a python error when exporting a 3D model with dat-gui panel using Qgis2threejs. I am using QGIS 3.18.3 Zurich. I have a simple DEM and an PNG display type, with extruded polygons, which work fine, until I try to add a polygon overlay, which is when I get a python error when exporting the model. The issue seems to be with the overlay object type, because if I try polygon as object type then I don't get the error.

This is the error I get:

2022-01-05T00:06:54 WARNING Traceback (most recent call last): File "C:/Users/hkr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Qgis2threejs\exporttowebdialog.py", line 175, in accept completed = exporter.export(filepath, cancelSignal=self.ui.pushButton_Cancel.clicked) File "C:/Users/hkr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Qgis2threejs\export.py", line 68, in export json_object = self.buildScene(cancelSignal=cancelSignal) File "C:/Users/hkr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Qgis2threejs\build.py", line 71, in buildScene obj["layers"] = self.buildLayers(cancelSignal) File "C:/Users/hkr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Qgis2threejs\build.py", line 88, in buildLayers obj = self.buildLayer(layer, cancelSignal) File "C:/Users/hkr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Qgis2threejs\export.py", line 161, in buildLayer return builder.build(True, cancelSignal) File "C:/Users/hkr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Qgis2threejs\buildvector.py", line 491, in build b = block.build() File "C:/Users/hkr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Qgis2threejs\buildvector.py", line 389, in build f.geometry(self.z_func, mapTo3d, self.useZM, be, self.grid)) File "C:/Users/hkr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Qgis2threejs\buildvector.py", line 105, in geometry polys = grid.splitPolygon(geom) File "C:/Users/hkr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Qgis2threejs\geometry.py", line 620, in splitPolygon for poly in self._splitPolygon(geom): File "C:/Users/hkr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Qgis2threejs\geometry.py", line 648, in _splitPolygon triangles = earcut.earcut(v, data["holes"], data["dimensions"]) File "C:/Users/hkr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Qgis2threejs\earcut\earcut.py", line 39, in earcut earcutLinked(outerNode, triangles, dim, minX, minY, invSize) File "C:/Users/hkr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Qgis2threejs\earcut\earcut.py", line 97, in earcutLinked indexCurve(ear, minX, minY, invSize) File "C:/Users/hkr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Qgis2threejs\earcut\earcut.py", line 357, in indexCurve p.z = zOrder(p.x, p.y, minX, minY, invSize) File "C:/Users/hkr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Qgis2threejs\earcut\earcut.py", line 428, in zOrder x = (x | (x TypeError: unsupported operand type(s) for