OVITO extension to read/write vectors with all attached properties from/to a compressed numpy file or a CSV file.
The configuration of the visual element is not exported.
The vectors created in examples/example.ovito
can be exported using the export file dialog selecting the "Vector file writer" format.
The resulting .npz
file matches examples/example.npz
. This file can be opened in OVITO Pro GUI. This reconstructs the vectors with all their properties. CSV files cannot be imported back into OVITO Pro.
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.npz")
from VectorIO import VectorFileWriter
# export npz file
export_file(data, "examples/example.npz", format=VectorFileWriter, key=data.vectors["example_vectors"])
-
From the OVITO Pro using the extensions GUI
-
OVITO Pro integrated Python interpreter:
ovitos -m pip install --user git+https://github.com/ovito-org/VectorIO
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/ovito-org/VectorIO
- Tested on OVITO version 3.12.0
Daniel Utt ([email protected])