|
| 1 | +# File Formats |
| 2 | + |
| 3 | +The current file formats supported by [meshio](https://github.com/nschloe/meshio) [^1] are |
| 4 | + |
| 5 | +> [Abaqus](http://abaqus.software.polimi.it/v6.14/index.html) (`.inp`), |
| 6 | +> ANSYS msh (`.msh`), |
| 7 | +> [AVS-UCD](https://lanl.github.io/LaGriT/pages/docs/read_avs.html) (`.avs`), |
| 8 | +> [CGNS](https://cgns.github.io/) (`.cgns`), |
| 9 | +> [DOLFIN XML](https://manpages.ubuntu.com/manpages/jammy/en/man1/dolfin-convert.1.html) (`.xml`), |
| 10 | +> [Exodus](https://nschloe.github.io/meshio/exodus.pdf) (`.e`, `.exo`), |
| 11 | +> [FLAC3D](https://www.itascacg.com/software/flac3d) (`.f3grid`), |
| 12 | +> [H5M](https://www.mcs.anl.gov/~fathom/moab-docs/h5mmain.html) (`.h5m`), |
| 13 | +> [Kratos/MDPA](https://github.com/KratosMultiphysics/Kratos/wiki/Input-data) (`.mdpa`), |
| 14 | +> [Medit](https://people.sc.fsu.edu/~jburkardt/data/medit/medit.html) (`.mesh`, `.meshb`), |
| 15 | +> [MED/Salome](https://docs.salome-platform.org/latest/dev/MEDCoupling/developer/med-file.html) (`.med`), |
| 16 | +> [Nastran](https://help.autodesk.com/view/NSTRN/2019/ENU/?guid=GUID-42B54ACB-FBE3-47CA-B8FE-475E7AD91A00) (bulk data, `.bdf`, `.fem`, `.nas`), |
| 17 | +> [Netgen](https://github.com/ngsolve/netgen) (`.vol`, `.vol.gz`), |
| 18 | +> [Neuroglancer precomputed format](https://github.com/google/neuroglancer/tree/master/src/neuroglancer/datasource/precomputed#mesh-representation-of-segmented-object-surfaces), |
| 19 | +> [Gmsh](https://gmsh.info/doc/texinfo/gmsh.html#File-formats) (format versions 2.2, 4.0, and 4.1, `.msh`), |
| 20 | +> [OBJ](https://en.wikipedia.org/wiki/Wavefront_.obj_file) (`.obj`), |
| 21 | +> [OFF](https://segeval.cs.princeton.edu/public/off_format.html) (`.off`), |
| 22 | +> [PERMAS](https://www.intes.de) (`.post`, `.post.gz`, `.dato`, `.dato.gz`), |
| 23 | +> [PLY](<https://en.wikipedia.org/wiki/PLY_(file_format)>) (`.ply`), |
| 24 | +> [STL](<https://en.wikipedia.org/wiki/STL_(file_format)>) (`.stl`), |
| 25 | +> [Tecplot .dat](http://paulbourke.net/dataformats/tp/), |
| 26 | +> [TetGen .node/.ele](https://wias-berlin.de/software/tetgen/fformats.html), |
| 27 | +> [SVG](https://www.w3.org/TR/SVG/) (2D output only) (`.svg`), |
| 28 | +> [SU2](https://su2code.github.io/docs_v7/Mesh-File/) (`.su2`), |
| 29 | +> [UGRID](https://www.simcenter.msstate.edu/software/documentation/ug_io/3d_grid_file_type_ugrid.html) (`.ugrid`), |
| 30 | +> [VTK](https://vtk.org/wp-content/uploads/2015/04/file-formats.pdf) (`.vtk`), |
| 31 | +> [VTU](https://vtk.org/Wiki/VTK_XML_Formats) (`.vtu`), |
| 32 | +> [WKT](https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry) ([TIN](https://en.wikipedia.org/wiki/Triangulated_irregular_network)) (`.wkt`), |
| 33 | +> [XDMF](https://xdmf.org/index.php/XDMF_Model_and_Format) (`.xdmf`, `.xmf`). |
| 34 | +
|
| 35 | +The additionally supported file formats are |
| 36 | + |
| 37 | +> [bgeo](https://github.com/wdas/partio)(`.bgeo`) [^2] |
| 38 | +> [mzd](https://github.com/InteractiveComputerGraphics/MayaMeshTools/tree/main/extern/mzd)(`.mzd`) |
| 39 | +
|
| 40 | +[^1]: Not all of the formats have been tested for this addon and some issues may still occur. |
| 41 | + |
| 42 | +[^2]: The addon only supports particle-only `.bgeo` files |
| 43 | + |
| 44 | +## Add support for customized file formats |
| 45 | + |
| 46 | +You can add support for your own customized file formats. For example, if you want to support `.example` file formats. |
| 47 | + |
| 48 | +To do that, |
| 49 | +1. Create a `example.py` file in the folder additional_file_formats |
| 50 | +2. Implement a function `def readexample_to_meshio(filepath):`, which reads the file from `filepath`, then construct a [meshio.Mesh](https://github.com/nschloe/meshio/wiki/meshio-Mesh()-data-structure) object. |
| 51 | +3. Add `meshio.register_format("example", [".example"], readexample_to_meshio, {".example": None})` in the global space |
| 52 | +4. Add `from . import example` in `additional_file_formats/__init__.py` |
| 53 | + |
| 54 | +You can check [additional_file_formats/bgeo.py](https://github.com/InteractiveComputerGraphics/blender-sequence-loader/blob/main/additional_file_formats/bgeo.py) as an example. |
0 commit comments