Extrude discrete terrain mesh with CreateTopology/CreateGeometry
Hello,
I want to load a discrete surface mesh representing a mountain terrain geology.msh and extrude it vertically in order to obtain a volume.
The example below was working fine with version 4.3.0
Merge "geology.msh";
CreateTopology;
Extrude {0, 0, 500} {
Surface{:}; Layers{5};
}
but with the most recent version (4.9.3 and git) I get some warning/error when trying to generate the 3D mesh.
Warning : Extrusion of periodic curves is not supported with the built-in kernel
...
Error : Inverse surface mapping could not converge
After looking for some similar examples (t13.geo) and issues here it seems that I should now be using the ClassifySurfaces
followed by the CreateGeometry
commands.
The mountain terrain is quite craggy and I don't want to smooth it too much, so it seems I have to classify surfaces according to a very small angle, and also detect boundary edges correctly to avoid the above warning about periodic curves. Something like
Merge "geology.msh";
ClassifySurfaces{5 * Pi / 180, 1, 1, Pi / 2};
CreateGeometry;
...
So far I didn't manage to make it work properly, I keep having these kind of errors
Error : Wrong topology of boundary mesh for parametrization
Is there something I am doing wrong, or should I be using a different approach?
Ps: I saw the terrain_*.py
examples in the API documentation, which could be applied here since my terrain surface comes from gridded input data, but I was hoping for a more general approach that would also work for unstructured terrain surfaces.
Thank you in advance for any help!