pyvista.DataObject.save#
- DataObject.save(
 - filename: Path | str,
 - binary: bool = True,
 - texture: NumpyArray[np.uint8] | str | None = None,
 - compression: _CompressionOptions = 'zlib',
 Save this vtk object to file.
Added in version 0.45: Support saving pickled meshes
- Parameters:
 - filename
str,pathlib.Path Filename of output file. Writer type is inferred from the extension of the filename.
- binarybool, default: 
True If
True, write as binary. Otherwise, write as ASCII.- texture
str,np.ndarray,optional Write a single texture array to file when using a PLY file. Texture array must be a 3 or 4 component array with the datatype
np.uint8. Array may be a cell array or a point array, and may also be a string if the array already exists in the PolyData.If a string is provided, the texture array will be saved to disk as that name. If an array is provided, the texture array will be saved as
'RGBA'Note
This feature is only available when saving PLY files.
- compression
strorNone, default: ‘zlib’ The compression type to use when
binaryisTrueand VTK writer is of type vtkXMLWriter. This argument has no effect otherwise. Acceptable values are'zlib','lz4','lzma', andNone.Noneindicates no compression.Added in version 0.47.
- filename
 
See also
Notes
Binary files write much faster than ASCII and have a smaller file size.