marian42 / mesh_to_sdf

Calculate signed distance fields for arbitrary meshes
https://pypi.org/project/mesh-to-sdf/
MIT License
991 stars 107 forks source link

mesh_to_voxel - incorrect #3

Open wbjang opened 4 years ago

wbjang commented 4 years ago

Dear Marian,

Thank you very much for releasing the code. I've tried to pre-process the ShapeNet objects using your library. When I use mesh_to_voxel, the voxel representation is slightly different from the original object as below, or it has some unnecessary stuff appearing on edges.

Screenshot 2020-03-19 at 14 47 54 Screenshot 2020-03-19 at 14 51 38 Screenshot 2020-03-19 at 14 47 45 Screenshot 2020-03-19 at 14 51 58

I tried to tackle down what the problem was..(I guess it is probably related to getting the point clouds from the depth images during Scan) but I could not figure it out. So, I raise this issue to you.

Kind regards,

WB

marian42 commented 4 years ago

Hi! Sorry for the trouble. I used this implementation with the ShapeNet dataset and I found that unfortunately not all of the meshes can be processed. In some cases, this is because the meshes are too far from anything that resembles a watertight mesh (although this approach can handle meshes with holes to an extent).

You can improve the results somewhat by tweaking the parameters (this is a tradeoff between quality and computation time) and you can also try the depth-buffer based approach (this is a tradeoff between accuracy and number of blob artifacts).

If you want to process the entire ShapeNet dataset, you can set the check_result parameter to True and it will throw an exception for voxel volumes with artifacts so that you can discard them.

If you can provide the mesh files (or Shapenet ids) for these particular meshes, I can try to debug the process for them.

wbjang commented 4 years ago

I will try as you suggest! Thank you for your quick response and sorry for the late reply.

wbjang commented 4 years ago

I think that the new version works much better - great work!!

anilesec commented 3 years ago

Dear Marian,

I would like to re-open the issue. I have a watertight mesh(hand mesh) and I tried to use mesh_to_vox(). But it gave unwanted reconstructions near the wrist. I tried to debug(but not successful) and what I found is that few of the voxel grid point's sdf values are miscalculated, this eventually makes marching cubes to wrongly reconstruct the surface.

It would be a really great help if you could help me debug this issue. looking forward to hearing from you.

Thank you!

anilesec commented 3 years ago

Dear Marian,

Thanks a lot for re-opening the issue. I have attached the input mesh(hand mesh) that I used. Perhaps it might be useful to help us.

HandMesh.zip

sraimund commented 2 years ago

@anilesec I faced a similar problem. When using the sign_method="depth" parameter, the artefacts disappear in your example mesh. The surface seems to be more rough though: comparison

philippwulff commented 1 year ago

Does someone know which shape classes from ShapeNet work well with mesh_to_voxels ? The planes class (02691156) for instance does not work at all (all conversions fail).

philippwulff commented 1 year ago

FYI, using sign_method="depth" greatly increases the number of meshes that can be preprocessed.