Meshio operation reference
Generated from the current declarations. Do not edit this file by hand.
Types, limits and defaults below describe resolved values. Runtime expressions must produce these types. Unknown options are rejected; defaults apply only when omitted. Constructor options must be constant after document composition.
Index#
convert#
Convert captured triangle/tetra meshes between ASCII VTU and legacyVTK 4.2 while checking coordinate units, ordered topology and point/cell arrays independently. Use for mesh interchange where preserving field associations matters.
Common mistakes and assumptions:
- Only coordinates change units; scalar/vector array units are not inferred.
- Strict subset refuses binary/compressed payloads and unsupported metadata instead of silently losing them.
Native binding: meshio.read / Mesh.points / meshio.write(binary=False). Output kind: ["geometry","text"].
Inputs: none.
| Option | Meaning | Type / constraints | Default |
|---|---|---|---|
source |
Required absolute local .vtu/.vtk regular file, matching sourceFormat, at most 16 MiB. No symlinks, devices or remote fetching. Bytes are captured and hashed; same-path changes invalidate reuse. | {"type":"string","minLength":1,"maxLength":4096} |
required |
sourceFormat |
Required vtu or vtk. vtu means a single inline ASCII UnstructuredGrid Piece; vtk means legacy 4.2 ASCII unstructured grid with FIELD arrays. The extension must match. Binary, appended, compressed and extra metadata sections are refused. | {"type":"enum","values":["vtu","vtk"]} |
required |
targetFormat |
Required vtu or vtk ASCII output, at most 32 MiB. Select the format the downstream consumer accepts. Ordered geometry/connectivity and supported arrays are preserved; dtype, block grouping and formatting may change. | {"type":"enum","values":["vtu","vtk"]} |
required |
sourceUnits |
Required coordinate length unit: m, cm, mm, in. Declare the unit already used by source XYZ; no inference from filename or scalar/vector fields. Incorrect declarations rescale an otherwise valid mesh incorrectly. | {"type":"enum","values":["m","cm","mm","in"]} |
required |
targetUnits |
Required output coordinate unit: m, cm, mm, in. XYZ including origin is multiplied by source metres-per-unit divided by target metres-per-unit. mm to m is 0.001; tetra volume changes by the cube. Field values are never rescaled. | {"type":"enum","values":["m","cm","mm","in"]} |
required |
lossPolicy |
Required strict: reject unsupported metadata, cell types or data arrays rather than dropping them. Strict preserves declared numeric/ordering semantics; it does not preserve ASCII formatting, numeric storage dtype or meshio block boundaries. | {"type":"enum","values":["strict"]} |
required |