Skip to content
/ dem2stl Public

Converts a Digital Elevation Model (DEM) raster surface to the STereoLithography (STL) format using the GDAL library

License

Notifications You must be signed in to change notification settings

cvr/dem2stl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dem2stl

Converts a Digital Elevation Model (DEM) topography surface to the STereoLithography (STL) format using the GDAL library.

Summary

The dem2stl.py python script converts a Digital Elevation Model (DEM) (such as GeoTIFF) to a STereoLithography (STL) file. The result is a topography surface that may be used to generate computational grids such as those required by OpenFOAM meshing programs.

The dem2stl.py script can cope with DEM raster files referenced to geographic coordinates (longitude and latitude), internally projecting into an UTM coordinate system using Proj4.

Example

The following example uses the GeoTIFF sample file GeogToWGS84GeoKey5.tif:

./dem2stl.py example/GeogToWGS84GeoKey5.tif example/GeogToWGS84GeoKey5.stl

The GeogToWGS84GeoKey5.stl output file may be viewed using meshlab:

GeogToWGS84GeoKey5.stl

Usage

usage: dem2stl.py [-h] [-v] [--band BAND] RASTER STL

Convert a GDAL raster (like a GeoTIFF heightmap) to an STL terrain surface.

positional arguments:
  RASTER         Input GeoTIFF image
  STL            Output STL path

optional arguments:
  -h, --help     show this help message and exit
  -v, --verbose  Print log messages
  --band BAND    Raster data band, defaults to 1

Requirements to run

The following python modules are required to run dem2stl.py:

On Debian-based systems these modules may be installed running:

apt-get install libpython2.7-stdlib libpython2.7-minimal \
    python-numpy python-gdal python-pyproj

Acknowledgments

dem2stl.py was based from the following python scripts:

About

Converts a Digital Elevation Model (DEM) raster surface to the STereoLithography (STL) format using the GDAL library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages