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

2D case for winding number / sdf computation #122

Open ottogin opened 2 years ago

ottogin commented 2 years ago

The C++ backend of IGL supports 2D cases in SDF and winding number (except for fast-winding number). However, the bindings have the assert that raises the following error on the 2D data:

ValueError: Invalid mesh vertices, v must have shape [#vertices, 3] but got v.shape = [25, 2]
arvigj commented 1 month ago

This case fails only on the assert, can we make the assert only if V.shape[1] == 3 and check if V.shape[1] == 2? Otherwise, if this is not safe enough, can we get a triangle mesh and take the boundary loop inside the binding?