pyvista.ExplicitStructuredGrid.save

pyvista.ExplicitStructuredGrid.save#

ExplicitStructuredGrid.save(
filename: Path | str,
binary: bool = True,
texture: NumpyArray[np.uint8] | str | None = None,
compression: _CompressionOptions = 'zlib',
) None[ソース]#

このVTKオブジェクトをファイルに保存します.

パラメータ:
filenamePath, str

出力ファイル名.VTUおよびVTK拡張がサポートされています.

binarybool, default: True

True の場合はバイナリ,それ以外の場合はASCIIで記述します.

texturenp.ndarray, str, None

無視される引数.スーパータイプとの互換性を維持するために保持されます.

compressionstr or None, default: 'zlib'

The compression type to use when binary is True and VTK writer is of type vtkXMLWriter. This argument has no effect otherwise. Acceptable values are 'zlib', 'lz4', 'lzma', and None. None indicates no compression.

Added in version 0.47.

備考

VTKは 'BLOCK_I''BLOCK_J' ,および 'BLOCK_K' セル配列を追加します.これらの配列は,明示的に構造格子を復元するために必要です.

>>> import pyvista as pv
>>> from pyvista import examples
>>> grid = examples.load_explicit_structured()
>>> grid = grid.hide_cells(range(80, 120))
>>> grid.save('grid.vtu')
>>> grid = pv.ExplicitStructuredGrid('grid.vtu')
>>> grid.plot(color='w', show_edges=True, show_bounds=True)
>>> grid.show_cells()
>>> grid.plot(color='w', show_edges=True, show_bounds=True)