pyvista.ExplicitStructuredGrid.save#
- ExplicitStructuredGrid.save(
- filename: Path | str,
- binary: bool = True,
- texture: NumpyArray[np.uint8] | str | None = None,
- compression: _CompressionOptions = 'zlib',
このVTKオブジェクトをファイルに保存します.
- パラメータ:
- filename
Path,str 出力ファイル名.VTUおよびVTK拡張がサポートされています.
- binarybool, default:
True Trueの場合はバイナリ,それ以外の場合はASCIIで記述します.- texture
np.ndarray,str,None 無視される引数.スーパータイプとの互換性を維持するために保持されます.
- 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
備考
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)