pyevtk stores the data associated with the given mesh in append data, that is given in a raw binary format.
Setting of raw:
Encoding as binary:
|
bin_pack = struct.pack(fmt, *dd) |
This is producing invalid XML files and other software is may unwilling to read the files (e.g. meshio see: nschloe/meshio#786)
We should use base64 encoded data, where the binary data is encoded with ascii-characters as suggested by VTK. Some references:
When using appended data with base64, we have to keep in mind, that the offsets are changing, since they address the character in the base64 encoded string and not the binary offset like with raw data:
meshio already implemented writing routines using base64 encoding. We should have a look there:
https://github.com/nschloe/meshio/blob/d9c05ae688858b5166630874f3ec875a43b8fd37/meshio/vtu/_vtu.py#L482
pyevtk stores the data associated with the given mesh in append data, that is given in a
rawbinary format.Setting of
raw:pyevtk/pyevtk/vtk.py
Line 636 in 488306a
Encoding as binary:
pyevtk/pyevtk/evtk.py
Line 98 in 488306a
This is producing invalid XML files and other software is may unwilling to read the files (e.g.
meshiosee: nschloe/meshio#786)We should use
base64encoded data, where the binary data is encoded withascii-characters as suggested by VTK. Some references:When using appended data with base64, we have to keep in mind, that the offsets are changing, since they address the character in the
base64encoded string and not the binary offset like withrawdata:pyevtk/pyevtk/vtk.py
Line 514 in 488306a
meshioalready implemented writing routines usingbase64encoding. We should have a look there:https://github.com/nschloe/meshio/blob/d9c05ae688858b5166630874f3ec875a43b8fd37/meshio/vtu/_vtu.py#L482