navis-org / skeletor

Extraction of 3D skeletons from meshes.
https://navis-org.github.io/skeletor/
GNU General Public License v3.0
209 stars 26 forks source link

inv_dist value for .by_teasar() #42

Open koenterheegde0507 opened 6 months ago

koenterheegde0507 commented 6 months ago

Hey,

I wanted to try the skeletonize.by_teasar() method but I have no clue what value to put for the inv_dist parameter. I'm currently using a value of 1 and get the following result, which doesn't seem right:

image

It looks exactly like the surface of my mesh. I used the following code: `mesh = tm.load_mesh(file_path) fixed = sk.pre.fix_mesh(mesh, remove_disconnected=5, inplace=False) skel_teasar = sk.skeletonize.by_teasar(fixed,inv_dist=1)

skel_teasar.show()`

schlegelp commented 6 months ago

Teasar on meshes works by walking from the root vertex to the most distant vertex. It then runs a ball along that path and marks all vertices within inv_dist as visited. Then it draws a path to the most distant of the remaining unvisited vertices and so on. So your inv_dist should be about the width of your branches - i.e. there is no one-size-fits-all as it depends on the scale of your mesh. From the screenshot it looks like inv_dist=1 is much too low.