OVITO extension to read/write surface meshes with all attached properties from/to a compressed numpy file.
The configuration of the visual element is not exported.
The surface mesh created in examples/example_01.ovito
can be exported using the export file dialog selecting the "Surface mesh file writer" format.
The resulting .npz
file matches examples/example_01.npz
. This file can be opened in OVITO Pro GUI. This reconstructs the surface mesh with all its properties.
Both import and export are also available from Python:
from ovito.io import import_file, export_file
# import npz file
pipeline = import_file("examples/example_01.npz")
from SurfaceMeshIO import SurfaceMeshFileWriter
# export npz file
export_file(data, "examples/example_01.npz", format=SurfaceMeshFileWriter, key=data.surfaces["surface"])
-
OVITO Pro integrated Python interpreter:
ovitos -m pip install --user git+https://github.com/nnn911/SurfaceMeshIO.git
The
--user
option is recommended and installs the package in the user's site directory. -
Other Python interpreters or Conda environments:
pip install git+https://github.com/nnn911/SurfaceMeshIO.git
- Tested on OVITO version 3.12.0
Daniel Utt ([email protected])