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

"bounding_radius" and mesh_to_voxels()for an unit sphere normalized mesh #17

Open anilesec opened 3 years ago

anilesec commented 3 years ago

Dear Authors,

I have few questions :

  1. I have a mesh which is already normalized to the unit sphere(mesh normalized by dividing the vertices with unit cube opposite corners diagonal distance, which is basically diameter(constant 50cm) of a circle). Now, I am trying to use

    • sample_sdf_near_surface(mesh). To get points and sdfs correctly, I have to comment out(disable) code _mesh = scale_to_unitsphere(mesh) because the input mesh is already normalized to unit sphere. Is my understanding correct? or is there any other things that I have to take care after commenting out mesh scaling line of code??
    • similarly, I run mesh_to_voxels(mesh, 64) to get voxels with sdf values by commenting out _mesh = scale_to_unitsphere(mesh) line of code. Could you please confirm if I am using this code right?
  2. while sampling points for creating voxels in function _get_rasterpoints(), grid points are sampled between -1 and 1 range. This means that we are sampling points that lie outside the unit sphere, right?

  3. _boundingradius is this the radius of circle that encloses mesh(what is the purpose of this)? I am asking this question becuase, I used water tight mesh to generate voxels and then reconstruct mesh using mcubes(like in example script). But I observed unnecessary reconstructions.

Looking forward to hearing your opinion on this.

Thank you for nice library.