[][src]Function vtkio::export

pub fn export(data: Vtk, file_path: &Path) -> Result<(), Error>

Export given vtk data to the specified file in BINARY format.

Examples

use std::path::PathBuf;
let vtk = Vtk {
    version: Version::new((4,1)),
    title: String::from("Tetrahedron"),
    data: DataSet::UnstructuredGrid {
        points: vec![0.0f32, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 1.0, 0.0].into(),
        cells: Cells { num_cells: 1, vertices: vec![4, 0, 1, 2, 3] },
        cell_types: vec![CellType::Tetra],
        data: Attributes::new(),
    }
};
export(vtk, &PathBuf::from("test.vtk"));