libigl-python-bindings icon indicating copy to clipboard operation
libigl-python-bindings copied to clipboard

`average_onto_vertices` only accepts 3-dim input

Open Sentient07 opened this issue 1 year ago • 2 comments

Hi,

As far as I understand, this function: https://libigl.github.io/libigl-python-bindings/igl_docs/#average_onto_vertices would be performing a matrix (incidence with voronoi weight?) vector multiplication. I don't understand why it's restricted to 3-dim input? It's not very clear from the doc, but when I would try a 4-dim input, I get the error, ValueError: Parameter s has invalid shape, expected s.shape = [13776, 3] but got s.shape = [13776, 4]

Shouldn't it accept any k-dim vector?

Thank you!

Sentient07 avatar Feb 19 '24 15:02 Sentient07

Seems to be a bug here:

https://github.com/libigl/libigl-python-bindings/blob/2516539247a282355bb6e13ebba907b529fa75d5/src/average_onto_vertices.cpp#L45

Happy to merge a PR

alecjacobson avatar Feb 20 '24 15:02 alecjacobson

Thank you! I'll try to send one soon :)

Sentient07 avatar Feb 20 '24 15:02 Sentient07