How can I extract a Digital Elevation Model from a 3D model of a building, made with SketchUp, using Blender,qgis or any other software?
Export your terrain object from SketchUp as a .dae file (or .kmz if you're using the free version - rename the .kmz extension to .zip and extract it find the .dae file inside)
Open the .dae mesh in Meshlab (free) and export mesh to .xyz points format, ignoring normals. Now, you can add the .xyz as a layer in QGIS using 'add delimited text layer'. Specify your x and y column, 'space' as custom delimiter, and that you have no header row. Looking at the data table, column 3 will contain your Z values.
Remember that unless your model was already georefenced, you will probably need to translate, rotate and scale the resulting layer, as required.
You can now use the raster > interpolation module to create a raster based DEM.
A second solution, which seems more efficient to me, after hours trying to achieve something with the same initial purpose (extraction of a DEM from a mesh constructed with Sketchup [in order to use visibility analysis tools].
- If possible, export the Sketchup object as a *.obj file, as it seems that it is the only format that keeps the scale and orientation of the model
- Open it with CloudCompare (opensource and free) and select it. If needed, georeference it [Ctrl + T / Edit > Apply transformation > "From > to axes", give the true coordinates of your origin point in Sketchup]
- Add sample points on the surface of your mesh [Edit>Mesh>Sample points]. As for the number of points, 1.000.000 per a 300 m² building with walls 3 m high give good results.
- Select your sampled cloud. Rasterize it [Tools > Projection > Rasterize]. Important parameters:
- Projection direction: Z
- Empty cells. Fill with kriging
Update grid to see the result, click on Raster in order to save the file.