zvtk.write#
- zvtk.write(ds: DataSet, filename: Path | str, *, progress_bar: bool = False, force_int32: bool = True, level: int = 3, n_threads: int | None = None) None#
Compress a PyVista or VTK dataset.
Supports the following classes.
All file types should end in
.zvtk, borrowing both from the legacy VTK extension.vtkand the.zstfile types.- Parameters:
- dspyvista.DataSet
Dataset to compress. All PyVista dataset types except for
pyvista.MultiBlockare supported.- filenamepathlib.Path | str
Path to the file.
- force_int32bool, default: True
Write offset and connectivity arrays as int32 whenever possible. Only applies to
pyvista.PolyDataandpyvista.UnstructuredGrid.- progress_barbool, default: True
Show a progress bar while writing to disk.
- levelint, default: 3
Compression level. Valid values are all negative integers through 22. Lower values generally yield faster operations with lower compression ratios. Higher values are generally slower but compress better.
- n_threadsint, optional
Number of threads to use when compressing. A value of
-1uses all available cores and0disables multi-threading.