You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I tested the import/export example, the following error occurred:
error[E0432]: unresolved imports `vtkio::export_ascii`, `vtkio::import`
--> src/main.rs:2:13
|
2 | use vtkio::{export_ascii, import};
| ^^^^^^^^^^^^ ^^^^^^ no `import` in the root
| |
| no `export_ascii` in the root
I want to ask how to solve this problem?
The text was updated successfully, but these errors were encountered:
Thank you for flagging this! The example in the readme is slightly outdated. I just pushed a commit fixing it. The correct usage is found on docs.rs. In general, for Rust libraries, docs.rs is a better source for finding examples because they are often at least compiled with the corresponding revision of the code.
With the current API, the example should be:
use vtkio::model::*;// import model definition of a VTK filefnmain(){use std::path::PathBuf;let file_path = PathBuf::from("assets/tet.vtk");letmut vtk_file = Vtk::import(&file_path).expect(&format!("Failed to load file: {:?}", file_path));
vtk_file.version = Version::new((4,2));// arbitrary change
vtk_file.export_ascii(&file_path).expect(&format!("Failed to save file: {:?}", file_path));}
When I tested the import/export example, the following error occurred:
I want to ask how to solve this problem?
The text was updated successfully, but these errors were encountered: