marian42 / mesh_to_sdf

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

NameError: name 'unit_sphere_sample_count' is not defined #14

Closed ckxz closed 4 years ago

ckxz commented 4 years ago

I am trying to reproduce your work on ShapeGAN ([https://github.com/marian42/shapegan]) with my own set of .stl meshes. When producing sdf point clouds out of my meshes with mesh_to_sdf package: indeed, variable 'unit_sphere_sample_count' is not defined in surface_point_cloud.py. I get around this error by setting argument "min_size" to 0 in "sample_sdf_near_surface", although the BadMeshException would be really helpful. Could you please explain me what exactly the variable 'unit_sphere_sample_count' is and how should it be defined? Thanks in advance and keep up the awesome work!

marian42 commented 4 years ago

Looks like I updated this project and didn't check if it still works with the shapegan repository. Sorry! Will look into fixing this later today.

marian42 commented 4 years ago

So sorry for not looking into this earlier :( It was simply a missing variable. Setting min_size to 0 is fine, it just skips a sanity check that would throw out bad meshes. If you don't have super thin meshes or non-watertight meshes, you don't need that check.

Are you still trying to reproduce the shapegan project? I'd like to know how far you got.

ckxz commented 4 years ago

Hey, no worries. I've been working with min_size = 0, as you suggest. I am currently training the point-gan. Let's see if it produces something interesting out of my dataset! I might bug you with other questions as I dig deeper in the project :)