沿法线缩放
我正在尝试“充气”网格。我发现基本上我正在寻找的内容是在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您描述为“inflate”的操作的技术名称是“dilate”,相反的操作称为“erode”。我将使用此网格作为输入来说明在 meshlab 中实现膨胀的两种方法:
每顶点几何函数
Meshlab 有一个名为
每顶点几何函数
的过滤器,可以让我们编写一个表达评估顶点的坐标。您可以在表达式中使用位置、法线、颜色、质量等。因此,您可以将法线添加到坐标以“膨胀”网格,使用这些表达式
根据网格的尺寸,您可能需要在公式中应用权重因子,如下所示:
这是结果:
如您所见,如果您的输入网格相对平滑(相邻顶点之间的法线没有太大变化),并且可能会在凹面区域产生一些自动碰撞问题(如狮子的眼睛),则此方法效果很好)
制服网格重采样
另一种方法(较慢但拓扑更准确)是使用均匀网格重采样过滤器并指定正偏移以获得扩张效果(或负偏移以获得侵蚀效果)。偏移可以是绝对的,也可以是相对于 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:
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
Depending of the dimensions of your mesh, you may want to apply a weight factor in the formula as here:
This is the 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 theClean Vertices
flag.This method works very well with concave areas, but is quite slow in comparison with displacement-along-normal method.