计算 3D 高度图的轮廓?

发布于 2024-07-17 11:46:50 字数 255 浏览 9 评论 0原文

我正在寻找一个函数或示例来生成表示高度图中特定高度处的轮廓的线条列表。

例如,

Lines[] = GetContours(Heights[512,512], HeightValue) 

其中 Heights 是 512x512 浮点值数组,HeightValue 是应绘制轮廓的高度。 高度可能包含该特定高度的多条线(例如马鞍或岛链)

是否有人拥有或知道在哪里可以获得生成此高度的算法?

I am looking for a function or example to produce a list of lines representing contours at a specific height within a heightmap.

Eg,

Lines[] = GetContours(Heights[512,512], HeightValue) 

Where Heights is a 512x512 array of floating point values, HeightValue is the height at which the contour should be drawn. Heights may contain multiple lines for that specific height (eg a Saddle, or island chain)

Does anyone have or know where to get an algorithm to generate this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

榆西 2024-07-24 11:46:50

你实际上想做的是绘制一条等值线。
请参阅我的问题不久前.
给出的链接其中一个答案非常有帮助。

What you're actually trying to do is to draw an iso-line.
see my question about it a while ago.
The link given in one of the answers was very helpful.

阳光下的泡沫是彩色的 2024-07-24 11:46:50

标准算法是行进方块

The standard algorithm is marching squares.

墨小沫ゞ 2024-07-24 11:46:50

算法:

a) 查找哪些多边形的顶点高于和低于您感兴趣的高度。

b) 将这些多边形的边与平面相交以获得平面上的线。

c) 将线条以条状连接在一起。

Algorithm:

a) Find which polygons have vertices above&below the height you're interested in.

b) Intersect the edges of those polygons with the plane to get lines on the plane.

c) Join the lines together in strips.

九公里浅绿 2024-07-24 11:46:50

看一下 Srtm2Osm,这是我用来从 NASA 的 SRTM 生成轮廓的工具数据。 您可以在 C# 代码中找到该算法。

Take a look at Srtm2Osm, a tool I've made to generate contours from NASA's SRTM data. You can find the algorithm in the C# code.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文