用于平滑开放 3D 网格边缘的算法 [英] Algorithm for smoothing edges of an open 3D mesh

查看:27
本文介绍了用于平滑开放 3D 网格边缘的算法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 3D 网格,它表示具有一些我想要平滑的粗糙边界的表面:

I have a 3D mesh which represents a surface with some rough boundaries which I would like to smooth:

我使用半边数据结构来存储几何图形,因此我可以轻松地遍历边界边、顶点和面.我还可以使用点积和叉积轻松确定给定的一对边是否为凸/凹.

I am using a half edge data structure for storing the geometry so I can easily iterate over the boundary edges, vertices and faces. I can also quite easily determine whether a given pair of edges is a convex/concave using a dot and cross product.

平滑边缘的最佳方法是什么,使它们形成一条连续的曲线,而不是图片中看到的清晰图案?

What would be the best approach for smoothing the edges out, so they form a continuous, curvy line, rather then the sharp pattern seen in the pictures?

推荐答案

  1. 计算两个相邻面之间的角度

我称它为 ada 为 abs delta 角度.如果它大于阈值,则表示该点是边缘.您可以将其计算为所有边缘线之间所有角度的 max.在 2D 中,它看起来像这样:

I call it ada as abs delta angle. If it is bigger then threshold it means this point is edge. You can compute it as max of all angles between all edge lines. In 2D it looks like this:

3D 网格中,每个点有超过 2 条线,因此您必须检查所有组合并选择最大的一个

in 3D mesh there is more then 2 lines per point so you have to check all combinations and select the biggest one

ada=max(abs(acos(n(i).n(j)))

其中 n(i),n(j) 是相邻面的法向量,其中 i != j

where n(i),n(j) are normal vectors of neighboring faces where i != j

识别有问题的区域

所以找到 ada > 的点阈值并创建这些点的列表

so find points where ada > threshold and create a list of these points

过滤这个列表

如果该点与任何其他点相距太远(distance>threshold),则将其从列表中删除以保留几何形状

if this point is too far from any other (distance>threshold) then remove it from list to preserve geometric shape

平滑点

你必须调整这一步以满足你的需求我会这样做:

you have to tweak this step to match your needs I would do this:

在列表中找到一组靠得很近的点,然后对它们应用一些平均几何或数字,例如:

find a group of points in the list which are close together and apply some averaging geometric or numeric on them for example:

pnt(i)=0.5*pnt(i)+0.25*pnt(i-1)+0.25*pnt(i+1)

这可以重复应用

蓝点和红点为原点,绿点为平滑点

blue and red dots are original points, green dots are smoothed points

这篇关于用于平滑开放 3D 网格边缘的算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆