81. plugins.mesh_io
—¶
You need to have python3-meshio installed to use this module. Source available from https://github.com/nschloe/meshio
81.1. Functions defined in module plugins.mesh_io¶
- plugins.mesh_io.writeMesh(fn, M)[source]¶
Write a mesh to one of many file formats.
- Parameters:
fn (path_like) – The output file name. The extentension should be any of the formats accepted by meshio (https://pypi.org/project/meshio/).
mesh (Mesh) – The Mesh to be written to the file.
Examples
>>> f = Path('test_filewrite.off') >>> M = Mesh(eltype='quad4').convert('tri3-u') >>> writeMesh(f, M) >>> print(f.read_text()) OFF # Created by meshio 4 2 0 0.0 0.0 0.0 1.0 0.0 0.0 1.0 1.0 0.0 0.0 1.0 0.0 3 0 1 2 3 2 3 0 >>> f.remove()