pyvista.DataObject.save#

DataObject.save(
filename: Path | str,
binary: bool = True,
texture: NumpyArray[np.uint8] | str | None = None,
) None[source]#

Save this vtk object to file.

Parameters:
filenamestr, 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.

texturestr, 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.

Notes

Binary files write much faster than ASCII and have a smaller file size.