6 Mesh and Scene IO are backed by VTK and assimp along with a couple custom readers. All geometry can read/write through MeshIO.
9 // Read ".vtk" file into tetMesh
10 auto tetMesh = MeshIO::read<TetrahedralMesh>("C:/ExampleLocation/exampleFile.vtk");
12 MeshIO::write(tetMesh , "C:/MyLocationToWriteTo/exampleFileOut.vtk");
18 The VisualObjectImporter is for importing more complex objects in the scene that cannot be described by a single geometry. This may involve multiple separable meshes, materials, textures, etc. Or even hierarchically defined meshes with multiple parts (it will flatten). It supports reading 3ds, obj, fbx, and dae. It can be used as follows:
21 std::shared_ptr<SceneObject> myObject = ObjectIO::importSceneObject("Object Name", "C:/ExamplePath/ExampleFile.dae", "C:/ExamplePath/");
22 // This can then be added to the scene
23 scene->addSceneObject(myObject);
27 <img src="media/MeshIO.png" width="300"/>
30 ## Supported Geometry Types
33 | File Format | Extension | IO | Backend | Geometry |
34 | :--- | :----: | :----: | :----: | :----: |
35 | VTK | `.vtk` | read/write | VTK | `PointSet`, `LineMesh`, `SurfaceMesh`, `TetrahedralMesh`, `HexahedralMesh` |
36 | VTU | `.vtu` | read/write | VTK | `TetrahedralMesh` , `HexahedralMesh` |
37 | VTP | `.vtp` | read/write | VTK | `SurfaceMesh` |
38 | Stereolithic | `.stl` | read/write | VTK | `SurfaceMesh` |
39 | Polygon | `.ply` | read/write | VTK | `SurfaceMesh` |
40 | Nearly Raw Raster Data | `.nrrd` | read/write | VTK | `ImageData` |
41 | NIFTI | `.nii` | read/write | VTK | `ImageData` |
42 | Meta Image | `.mhd` + `.raw` | read/write | VTK | `ImageData` |
43 | Joint Photo Experts Group | `.jpg` or `jpeg` | read/write | VTK | `ImageData` |
44 | Portable Network Graphics | `.png` | read/write | VTK | `ImageData` |
45 | Bitmap | `.bmp` | read/write | VTK | `ImageData` |
46 | Wavefront | `.obj` | read | Assimp | `LineMesh`, `SurfaceMesh` |
47 | Collada | `.dae` | read | Assimp | `LineMesh`, `SurfaceMesh` |
48 | Filmbox | `.fbx` | read | Assimp | `LineMesh`, `SurfaceMesh` |
49 | Autodesk 3ds | `.3ds` | read | Assimp | `LineMesh`, `SurfaceMesh` |
50 | Vega | `.veg` | read/write | VegaFEM | `TetrahedralMesh`, `HexahedralMesh` |
51 | GMSH | `.msh` | read/write | iMSTK | `LineMesh`, `SurfaceMesh`, `TetrahedralMesh`, `HexahedralMesh` |
53 * Note `.mhd` is the only format that supports read/write of 3d images with linear offsets.
54 * No image format here supports orientations
55 * TetWild can generate TetrahedralMesh's from SurfaceMesh in the ".msh" format, directly read by iMSTK.
56 * iMSTK does not support any mixed cell geometries