trimesh icon indicating copy to clipboard operation
trimesh copied to clipboard

Smoothing shifts mesh coordinates

Open NikDrummond opened this issue 5 years ago • 3 comments

I've noticed that mesh smoothing seems to shift the mesh in space:

mesh = trimesh.load_mesh('../mesh.stl')
mesh2 = mesh.copy()
mesh2 = trimesh.smoothing.filter_laplacian(mesh2)


scene = trimesh.Scene([mesh,mesh2])
scene.show()

Where I would think these meshes should be overlapping. The results are the same for trimesh.smoothing.filter_taubin() and trimesh.smoothing.filter_humphrey()

Screenshot from 2020-11-30 16-11-36

NikDrummond avatar Nov 30 '20 15:11 NikDrummond

Yeah just looking quickly there's a number of operations that look like they'd produce offsets, like here where it's just multiplying by a scaling factor. I think that logic should probably be something like ((vertices - center_mass) * scale) + center_mass

mikedh avatar Dec 01 '20 19:12 mikedh

Hi @mikedh, thanks again for this awesome library with so many functionalities, looks like a lot of work! Is there an update on the shifting of coordinates in space? The problem is still happening.

postnubilaphoebus avatar Mar 06 '24 10:03 postnubilaphoebus