I would like to generate a 3d terrain model of an area, and I am stuck on creating the TIN (which I will convert to an STL). I know there are plenty of ways to use ArcGIS, QGIS, 3DEM, and various other programs to go through and generate a TIN for an area by hand and Stack Exchange answers explaining them. But that does not fit my use case, I need a solution in which I can script the whole process. Preferable in python, but if another solution exists I would not throw it out. I am also willing to sacrifice some accuracy for speed. The result will be printed and does not need to be perfect.
I have SRTM 1 arc-second data, which I downloaded from NASA. The first thing I attempted to do was generate a TRN out of it, which did work, however it was huge and unwieldy to use. There are way too many triangles. The plains have the same amount of triangle as the Himalayan Mountains. If the data were sparse, I would use scipy.spatial.Delaunay, but since it is a regular grid it doesn't simplify things any.
I also thought about just down sampling to make it smaller (or using coarser resolution data), but that doesn't actually address the real problem of needing the simplify the surface that was generated.
Is there a library I am missing to generate TINs in python?
Is there a better approach to what I am trying?
Possibly generate contour lines for an area, then triangulate them?
If that is possible, what library would I use to generate the contour lines?
If nothing else can someone point me to documentation, or a paper on how to generate a simplified TIN out of gridded elevation data?
If I have to write the library myself I will. The primary requirement I have is that it has to be something I can script. A cross platform solution would be ideal, I would like to run it on Linux, but I will take what I can get.