百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
D

dem2mesh

> 编程语言
开源

从高程模型快速生成 2.5D 三角网格。

100 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

从高程模型快速生成 2.5D 三角网格。

dem2mesh

Fast generation of 2.5D meshes from elevation models.

Quickstart

bash
docker run -it --rm -v /path-your-data:/data kladess/dem2mesh dem2mesh -rtc -verbose -inputFile /data/dem.tif -outputFile /data/mesh.ply

Dependencies

GDAL and OpenMP are the only dependencies. To install it run:

bash
sudo apt-get install -y libgdal-dev libomp-dev

Building

bash
mkdir build && cd build
cmake ..
make

Running

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

:warning: 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.
-maxConcurrency Maximum number of threads to use. Defaults to all CPUs available.
-edgeSwapThreshold Dot product threshold (between 0-1) to perform edge collapses. Performing edge collapses can violate the 2.5D constraints, but leads to better triangles for vertical structures. Defaults to disabled.
-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

  • Fast Quadric Mesh Simplification code modified from https://github.com/sp4cerat/Fast-Quadric-Mesh-Simplification
  • Command line parser library modified from https://github.com/mkazhdan/PoissonRecon

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C++25d3ddemdsm

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言