【问题标题】:Algorthim to create a mesh between two sets of points在两组点之间创建网格的算法
【发布时间】:2014-03-11 02:04:35
【问题描述】:

是否有一种算法可以在两个 3D 点列表之间创建网格,每个列表形成一个完整的循环?

Example Image

在链接的图像中,红点是第一组,蓝色点是第二组,灰色是连接两组的三角形的期望输出,填补了它们之间的空隙。

这个image 显示了我想在 3d 中准确地做的事情,紫色点形成第一个地形的轮廓,其他点形成第二个地形中一个洞的轮廓,算法应该创建一个网格来填补内外轮廓之间的空白。

【问题讨论】:

  • 请告诉我们你尝试了什么?
  • 你最终会得到一个 tet-mesh,当在 3D 中完成时,它将外表面与内表面连接起来。这是你需要的吗?如果可以的话,你能告诉你为什么需要这个,在 3d 中。
  • 我已经编辑了问题并添加了另一张图片和对我正在尝试做的事情的解释。
  • 这个question 引用了一些网格技术。

标签: graphics 3d mesh


【解决方案1】:

您能否验证以下方法是否有效。基本思想是,当您围绕内部节点循环时,您会从外部节点获得最近的节点并添加一条边。外环上最近的应该是已经设置的那个,或者是它的邻居之一。所以你可以像这样利用它:

innernode = firstnode(innerloop)
outernode = NULL

while(innernode) do

    if(outernode) then
        //For every new node, check if the outer node is the nearest, 
        //or if any of its neighbours are
        newouternode = find_nearest_among(outernode, prev(outernode), 
                                            next(outernode), innernode)
        if(newouternode != outernode) then
            //If we found a new node, add an extra edge, 
            //otherwise, we'll have quads
            //The figure shows why this is needed.
            make_edge(innernode, outernode)
            outernode = newouternode 
        end
    else
        //the first time, find the closest node in the outer loop)
        outernode = find_nearest(outerloop, innernode)
    end
    //continue making an edge to the outernode, we're closest to
    make_edge(innernode, outernode)

    //move on
    innernode = next(innernode)
end

【讨论】:

  • 感谢 Arun,我已经验证了它,它在上述用例中按预期工作,我也在寻找一种通用算法,我认为这可能对未来的任何人都有帮助@ 987654321@
【解决方案2】:

输入是两个循环点,一个循环在另一个循环内。

想法是通过沿相同方向(平行)遍历循环来连接点。在外部循环中找到一个点,在内部循环中找到一个点,这样连接它们的线段不会与任何循环相交。移动到下一个段有两种可能性,在内环上移动点或在外环上移动点。测试这两个线段是否与循环相交,以及(如果需要)上一段和下一段产生的三角形的质量,并决定使用下一段。重复移动段,直到所有点回到初始段。

【讨论】:

  • 感谢您的回答,但我认为您在这里的建议不适用于我的问题或一般 3D,我已经链接了一个新图像:Crack,如您所见紫色形成轮廓的点需要与三角形连接,另一组点形成另一个轮廓以填充裂缝。
猜你喜欢
  • 1970-01-01
  • 2022-10-14
  • 1970-01-01
  • 2017-02-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多