libigl / libigl-python-bindings

libigl python bindings
https://libigl.github.io/libigl-python-bindings/
GNU General Public License v3.0
315 stars 62 forks source link

`average_onto_vertices` only accepts 3-dim input #225

Open Sentient07 opened 7 months ago

Sentient07 commented 7 months ago

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!

alecjacobson commented 7 months ago

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

Sentient07 commented 7 months ago

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