minorua / Qgis2threejs

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

Extrusions of shapefile generate many edges that might not be necessary ? #236

Closed bdamay closed 3 years ago

bdamay commented 3 years ago

Hi, It appears that exporting shapefile with extrusions generate many edges that might not be necessary. I would like to get rid of these to be able to reshape meshes more easily inside a modeling software like blender for example.

Say i start from a shape like this in Qgis image

Within QGis2Three after gltf file export and import into blender i get something like this:

image

Notice triangle meshes a bit everywhere. I wonder if this is possible to have a clean z-extruded area here instead.

Help would be much appreciated.

larsgrobe commented 3 years ago

Hi Benoit,

I guess that this is not really related to this software, but your model looks like a clean triangle mesh to me. If you want to have, for unknown reasons, a quadrilateral or other polygonal geometry, you may try to merge coplanar triangles e.g. in Blender. Note that usually this is not really desirable.

Best, Lars.

Am 25.01.2021 um 18:03 schrieb Benoit DAMAY notifications@github.com:

Hi, It appears that exporting shapefile with extrusions generate many edges that might not be necessary. I would like to get rid of these to be able to reshape meshes more easily inside a modeling software like blender for example.

Say i start from a shape like this in Qgis https://user-images.githubusercontent.com/16347726/105737853-b4230a00-5f36-11eb-8c8d-12d9700e5ea9.png Within QGis2Three after gltf file export and import into blender i get something like this:

https://user-images.githubusercontent.com/16347726/105737518-57bfea80-5f36-11eb-86de-097bc21895a7.png Notice triangle meshes a bit everywhere. I wonder if this is possible to have a clean z-extruded area here instead.

Help would be much appreciated.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/minorua/Qgis2threejs/issues/236, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJIT26HM4KOYZ5ESVQBWS3TS3WP4RANCNFSM4WSBZROQ.

bdamay commented 3 years ago

Thank you for your quick answer,

I understand this is much more a Three.js itself matter. Looking into how volumes are created it seem to first create a extruded geometry and then creates a solid with the Mesh method as shown here: (QGis2Three.js around line 3110) var geom = new THREE.ExtrudeBufferGeometry(shape, {bevelEnabled: false, depth: f.geom.h}); var mesh = new THREE.Mesh(geom, materials.mtl(f.mtl.face));

Then i understand it's not quite possible to get what i directly wanted.
I might try to merge coplanar triangles in blender but i most surely deal with the way it is ok.

Best, Benoit