简体   繁体   English

Meshlab Laplacian Smooth 引入了尖峰

[英]Meshlab Laplacian Smooth introduces spikes

I am using MeshLab to smooth a mesh obtained from a 3d numpy array through marching_cubes and pymesh.我正在使用 MeshLab 平滑从 3d numpy 阵列通过 marching_cubes 和 pymesh 获得的网格。 I am processing a few similar meshes and only one of them is giving me this problem.我正在处理一些类似的网格,其中只有一个给我这个问题。 The filter used is Laplacian Smooth with parameters:使用的滤波器是带有参数的拉普拉斯平滑滤波器:

  • smoothing steps = 1平滑步骤 = 1
  • 1D boundary smoothing = True一维边界平滑 = True
  • cotangent weighting = True余切加权 = True

Attached are the images of the mesh before and after the Laplacian smoothing.附上拉普拉斯平滑前后的网格图像。 Unfortunately the images have to be cropped in the interested areas due to privacy concerns.不幸的是,由于隐私问题,必须在感兴趣的区域裁剪图像。
Any help in tracking down the issue or any debugging suggestions would be really helpful.追踪问题的任何帮助或任何调试建议都会非常有帮助。
Thank you!谢谢!

mesh before laplacian smooth in first region第一区域拉普拉斯平滑之前的网格

first spike第一个尖峰

mesh before laplacian smooth in second region第二区域拉普拉斯平滑之前的网格

second spike第二个尖峰

Can you provide a mesh sample?你能提供一个网格样本吗? it could be a numerical issue due to degenerate zero area triangles that can happen as a result of MarchingCubes.由于 MarchingCubes 可能导致退化的零面积三角形,这可能是一个数值问题。 The reason is that Laplacian smoothing tries to move vertices along the tangent planes of the surface that results undefined for zero area triangles.原因是拉普拉斯平滑试图沿着曲面的切平面移动顶点,导致零面积三角形未定义。 Eventually you could also try to remove those degenerate triangles by running a merge close vertices filter.最终,您还可以尝试通过运行合并关闭顶点过滤器来删除那些退化的三角形。 This issues can came up also because desktop meshlab runs on float while its python counterpart pymeshlab runs on double.这个问题也可能出现,因为桌面 meshlab 运行在浮动上,而其 python 对应的 pymeshlab 运行在 double 上。 Eventually just try the mesh from numpy arrays directly using pymeshlab最终只需使用 pymeshlab 直接从 numpy arrays 尝试网格

import numpy as np
import pymeshlab as ml
import k3d

ms = ml.MeshSet()
ms.set_verbosity(True)
ms.apply_filter('implicit_surface',voxelsize=0.050000000001,expr="x*x+y*y+z*z-0.5")
#ms.apply_filter("merge_close_vertices")
ms.apply_filter("laplacian_smooth",stepsmoothnum=1)
ms.apply_filter("compact_vertices")
ms.apply_filter("compact_faces")

plot = k3d.plot()
plot += k3d.mesh(ms.current_mesh().vertex_matrix().astype(np.float32), 
                 ms.current_mesh().face_matrix().astype(np.uint32),color=0xf0f0c0)
plot.display()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM