alecjacobson / gptoolbox

Matlab toolbox for Geometry Processing.
MIT License
628 stars 166 forks source link

skeleton_extraction - wrong mesh or bug? #33

Open oqilipo opened 7 years ago

oqilipo commented 7 years ago

I tried to run skeleton_extraction with this triangle mesh: Femur_L.zip

[V, F] = readPLY('Femur_L.ply');
[W,E,U] = skeleton_extraction(V,F);

But I get the following error

Index exceeds matrix dimensions.

Error in adjacency_matrix (line 25)
  A = sparse([E(:,1) E(:,2)],[E(:,2) E(:,1)],1);

Error in skeleton_extraction (line 160)
    A = adjacency_matrix(E)+speye(size(W,1));

Error in skeleton_example (line 16)
[W,E,U] = skeleton_extraction(V,F)

Is there a problem with the mesh or is it a bug?

Thanks in advance

oqilipo commented 7 years ago

For now, I use this repository with the same mesh converted to off format and it works quite well. https://github.com/ataiya/cloudcontr

Kind regards

alecjacobson commented 7 years ago

I think this function had some hard coded parameters that assumed the mesh would roughly fit in the unit box. I pushed a potential fix.

The final extraction part is still sequential and very slow on moderate meshes like your femur.

oqilipo commented 7 years ago

Thanks, but I still get an error with the file: Femur_L_off.zip and the code:

[V, F] = readOFF('Femur_L.off');

[W,E,U] = skeleton_extraction(V,F);

Error:

Index exceeds matrix dimensions.

Error in adjacency_matrix (line 25)
  A = sparse([E(:,1) E(:,2)],[E(:,2) E(:,1)],1);

Error in skeleton_extraction (line 160)
    A = adjacency_matrix(E)+speye(size(W,1));

Kind regards