libigl-python-bindings
libigl-python-bindings copied to clipboard
Reading files with pathlib
Have to convert to string before reading in

Interesting, I have no idea how to fix this. Seems more of an issue in pybin11 than igl
in the code I just convert it to a string which works i.e. I pass in str(_meshes_path / f"{mesh_name}.obj") in this example
My understanding is that the implicit feature request here is for igl.read* (and igl.write*) functions to accept pathlib paths as input in addition to strings. Sounds like a good request and would be happy to merge a PR if anyone wants to take it on.
My understanding is that the implicit feature request here is for
igl.read*(andigl.write*) functions to accept pathlib paths as input in addition to strings. Sounds like a good request and would be happy to merge a PR if anyone wants to take it on.
Yep, that's what I was thinking!
I think this means that the underlying C++ function in libigl should probably take std::filesystem::path as input.
If I read that page correctly then std::filesystem::path is convertable to string as well. So maybe we could already start with using std::filesystem::path as the input type on the bindings.