Code Monkey home page Code Monkey logo

dem2mesh's Introduction

dem2mesh

Fast generation of 2.5D meshes from elevation models.

image

image

Dependencies

GDAL is the only dependency. To install it run:

sudo apt-get install -y libgdal-dev 

Building

mkdir build && cd build
cmake ..
make

Running

./dem2mesh -rtc -verbose -inputFile dem.tif -outputFile mesh.ply

⚠️ The DEM should use a coordinate reference system (CRS) that has matching horizontal and vertical units (for example, UTM). If you are getting stretched or deformed results, double check your CRS and use gdalwarp to reproject the raster DEM. https://www.gdal.org/gdalwarp.html

Options

Flag Description Required
-inputFile Path to DEM raster datasource (GDAL compatible)
-outputFile Path to PLY mesh output
-maxVertexCount Target number of vertices for the output mesh. This number is not always guaranteed to be reached. Defaults to 100000
-maxTileLength Max length of a tile. Smaller values take longer to process but reduce memory usage by splitting the meshing process into tiles. Defaults to 1000.
-aggressiveness Value between 1 and 10 that specifies how "aggressive" the mesh simplification process should be at each iteration. Higher values simplify the mesh more aggressively but can decrease the fidelity of the mesh. Defaults to 5.
-bandNum Raster band # to use. Defaults to 1.
-rtc Use Relative To Center (RTC) X/Y coordinates in the output PLY mesh. This can be useful since most 3D visualization software use floating coordinate precision to represent vertices and using absolute coordinates might lead to jittering artifacts.
-verbose Print verbose output.

FAQ

How does it compare to https://github.com/heremaps/tin-terrain ?

The main difference is the meshing approach and output type. Tin-terrain uses a greedy approach, dem2mesh uses a gridding + simplification approach. Tin-terrain can output to quantized-mesh format (useful for displaying in Cesium), dem2mesh does not.

The meshing approach changes the way triangles are placed in the mesh. Greedy approaches tend to generate areas with large triangles in flat parts of the mesh, which is something we wanted to avoid in dem2mesh. The gridding approach generates more evenly sized and distributed triangles. Good sized triangles are important in OpenDroneMap for generating good orthophotos during the texturing step.

Credits

dem2mesh's People

Contributors

pierotofy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.