沿法线缩放

发布于 2025-01-09 01:26:40 字数 96 浏览 0 评论 0原文

我正在尝试“充气”网格。我发现基本上我正在寻找的内容是在 Blender 中通过沿法线缩放所有内容来执行的。在 MeshLab 中是否有办法精确地做到这一点(设置精确的百分比)?

I'm trying to 'inflate' a mesh. I see that basically what I'm looking for is performed in Blender by scaling everything along the normals. Would there be a way to do this precisely (setting a precise percentage) in MeshLab?

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

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

发布评论

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

评论(1

何处潇湘 2025-01-16 01:26:40

您描述为“inflate”的操作的技术名称是“dilate”,相反的操作称为“erode”。我将使用此网格作为输入来说明在 meshlab 中实现膨胀的两种方法:

input mesh

每顶点几何函数

Meshlab 有一个名为每顶点几何函数 的过滤器,可以让我们编写一个表达评估顶点的坐标。您可以在表达式中使用位置、法线、颜色、质量等。

因此,您可以将法线添加到坐标以“膨胀”网格,使用这些表达式

x = x + nx
y = y + ny
z = z + nz

根据网格的尺寸,您可能需要在公式中应用权重因子,如下所示:

x = x + 0.05 * nx
y = y + 0.05 * ny
z = z + 0.05 * nz

这是结果:
结果

如您所见,如果您的输入网格相对平滑(相邻顶点之间的法线没有太大变化),并且可能会在凹面区域产生一些自动碰撞问题(如狮子的眼睛),则此方法效果很好)

制服网格重采样

另一种方法(较慢但拓扑更准确)是使用均匀网格重采样过滤器并指定正偏移以获得扩张效果(或负偏移以获得侵蚀效果)。偏移可以是绝对的,也可以是相对于 bbox 对角线测量的。在这种情况下,将创建一个新的网格以确保不存在自动碰撞。输出精度取决于您设置的精度参数的值。我建议激活 Clean Vertices 标志。

输入图片此处描述

此方法对于凹面区域效果非常好,但与沿法线位移的方法相比速度相当慢。

The technical name of the operation that you describe as 'inflate' is 'dilate', and the opposite operation is named 'erode'. I will use this mesh as input to illustrate two ways to achieve dilation in meshlab:

input mesh

Per-Vertex Geometric Function

Meshlab has a filter named Per-Vertex Geometric Function that let to write one expression to evaluate as coordinates of vertex. You can use position, normal, colors, quality, etc... in the expression.

So you can add the normal to coordinates to "inflate" the mesh, with those expression

x = x + nx
y = y + ny
z = z + nz

Depending of the dimensions of your mesh, you may want to apply a weight factor in the formula as here:

x = x + 0.05 * nx
y = y + 0.05 * ny
z = z + 0.05 * nz

This is the result:
result

As you see, this work well if your input mesh is relatively smooth (there is no great changes in the normal between neighbors vertex) and can produce some auto-collision problems in concave areas (as the eyes of the lion)

Uniform mesh resampling

A different method (slower but topologically more accurate) is using the uniform mesh resampling filter and specifying a positive offset to obtain a dilate effect (or negative to erode). The offset can be absolute or relative to bbox diagonal measure. In this case a new mesh is created to ensure there is no auto-collisions. The output accuracy depends on the value for the precision parameter you set. I suggest to activate the Clean Vertices flag.

enter image description here

This method works very well with concave areas, but is quite slow in comparison with displacement-along-normal method.

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