Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Massmatrix and Cotmatrix both returning an empty matrix. #242

Open
NarinderS opened this issue Nov 1, 2024 · 4 comments · May be fixed by #243
Open

Massmatrix and Cotmatrix both returning an empty matrix. #242

NarinderS opened this issue Nov 1, 2024 · 4 comments · May be fixed by #243

Comments

@NarinderS
Copy link

NarinderS commented Nov 1, 2024

It seems like the massmatrix and cotmatrix functions are always returning an empty matrix, without any errors or warnings. Here is a simple setup:

import igl
print(igl.__version__)
V,F = igl.triangulated_grid(3,3)
M1 = igl.massmatrix(V,F,igl.MASSMATRIX_TYPE_BARYCENTRIC)
M2 = igl.massmatrix(V,F,igl.MASSMATRIX_TYPE_VORONOI)
L = igl.cotmatrix(V,F)
print(M1)
print(M2)
print(L)

Prints:

2.5.1
<Compressed Sparse Column sparse matrix of dtype 'float64'
	with 0 stored elements and shape (9, 9)>
<Compressed Sparse Column sparse matrix of dtype 'float64'
	with 0 stored elements and shape (9, 9)>
<Compressed Sparse Column sparse matrix of dtype 'float64'
	with 0 stored elements and shape (9, 9)>

I ran this on a bare-bones venv, using Python 3.12.7. Pip freeze shows:

libigl==2.5.1
numpy==2.1.2
scipy==1.14.1

And strangely dropping the Python version to 3.11.10 and using libigl==2.4.1 does not help either.
Am I missing some sort of dependency?

@alecjacobson
Copy link
Contributor

This is a known issue and I'm working on a fix.

It'd be helpful to know if you installed libigl-python-bindings from source or using pip with precompiled binaries.

@NarinderS
Copy link
Author

This was pip with precompiled binaries, for both Py3.12.7 + IGL2.5.1 and Py3.11.10 + IGL2.4.1

@alecjacobson
Copy link
Contributor

Yikes. Interesting. Well the short answer is that the issues is a problem with numpy >1.26.4 and pybind11 (a dependency of libigl's bindings procedure). I thought that bindings built with old numpy would still work when used with a newer numpy. You could try downgrading your numpy for now.

@NarinderS
Copy link
Author

Downgrading to numpy 1.26.4 seems to have solved the issue, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants