Create a box mesh with an irregular surface (defined by a DEM)

6 months ago by

I have a Digital Elevation Model in the form of a raster (a grid of elevation numbers within a rectangular region of the Earth's surface). I am trying to create a mesh which would form a 3D box, with the  DEM forming the upper surface - a bit like cutting a block out of the ground with the mountains and hills still on top of it.

I've experimented with a few things, and I've figured out how to convert my DEM to a mesh using MeshLab, which I can then import into mshr as a Surface3D object, but I can't figure out how to combine this with other primitives to get the 3D block. Does anyone have any ideas?

Many thanks,

Community: FEniCS Project
I'm generating such meshes with TetGen and Triangle, which works very well. The work flow would be:

1. Create a flat surface mesh in 2D with Triangle
2. Add a third dimension for the Z-values to all nodes afterwards
3. Interoplate the DEM on all surface mesh nodes to assign the topography
4. add five 5 faces to have a valid PLC block.
5. Mesh the latter with TetGen and maybe assign domain markers
6. Convert the .mesh output to .xml or .h5

I have automated this procedure, but the code is more than one function or script I could post here. If you are interested, send me a PM,

written 6 months ago by RR  
Hi RR, many thanks for your response. In the end I imported the raster into python using Gdal, wrote a script to build the geometry from the points up using using pygmsh, and meshed the results using gmsh. But this took a while to code up -  I'm wondering if your way would have been quicker ...
written 6 months ago by tdb  
Please login to add an answer/comment or follow this question.

Similar posts:
Search »