elrnv / meshx

Mesh eXchange library.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error when saving TriMesh as .obj

FliegendeWurst opened this issue · comments

When trying to save a TriMesh as an .obj file, I get this error:

thread 'main' panicked at /home/arne/src/meshx/src/io/obj.rs:528:10:
called `Result::unwrap()` on an `Err` value: DoesNotExist("object")
stack backtrace:
   0: rust_begin_unwind
             at /rustc/c469197b19d53a6c45378568f73c00986b20a5a5/library/std/src/panicking.rs:617:5
   1: core::panicking::panic_fmt
             at /rustc/c469197b19d53a6c45378568f73c00986b20a5a5/library/core/src/panicking.rs:67:14
   2: core::result::unwrap_failed
             at /rustc/c469197b19d53a6c45378568f73c00986b20a5a5/library/core/src/result.rs:1652:5
   3: core::result::Result<T,E>::unwrap
             at /rustc/c469197b19d53a6c45378568f73c00986b20a5a5/library/core/src/result.rs:1077:23
   4: meshx::io::obj::convert_polymesh_to_obj_format
             at ./src/io/obj.rs:526:24
   5: meshx::io::save_polymesh_impl
             at ./src/io.rs:231:23
   6: meshx::io::save_trimesh
             at ./src/io.rs:280:5
   7: tutorial::main
             at ./examples/tutorial.rs:86:9
   8: core::ops::function::FnOnce::call_once
             at /rustc/c469197b19d53a6c45378568f73c00986b20a5a5/library/core/src/ops/function.rs:250:5

Hello @FliegendeWurst, thank you for submitting this issue! I believe I found the cause of this bug, and fixed it in 0f2a1df

Please let me know if you are still running into this issue and we can reopen it.

Thanks for the fix @elrnv! I'm no longer running into the issue.

Since it was still possible to save as .vtk, I spent quite some time investigating how to convert from that format to .obj. It is rather difficult to find a good solution... I think you would attract quite a few users if you build an easy-to-use conversion tool based on your library ;)