pyvista.merge

目次

pyvista.merge#

merge(
datasets,
merge_points: bool = True,
main_has_priority: bool | None = None,
progress_bar: bool = False,
)[ソース]#

複数のデータセットをマージします.

注釈

このフィルタの動作は PolyDataFilters.boolean_union() フィルタとは異なります. このフィルタはマニフォールドメッシュを作成しようとはせず,2つのメッシュが重なっている場合には内部サーフェスを含みます.

警告

The merge order of this filter depends on the installed version of VTK. For example, if merging meshes a, b, and c, the merged order is bca for VTK<9.5 and abc for VTK>=9.5. This may be a breaking change for some applications. If only merging two meshes, it may be possible to maintain some backwards compatibility by swapping the input order of the two meshes, though this may also affect the merged arrays and is therefore not fully backwards-compatible.

パラメータ:
datasetssequence[pyvista.DataSet]

Sequence of datasets. Can be of any pyvista.DataSet.

merge_pointsbool, default: True

True の時には同等のポイントをマージします.

main_has_prioritybool, default: True

このパラメータが Truemerge_points=True がtrueの場合,マージグリッドの配列は元のメインメッシュによって上書きされます.

バージョン 0.46 で非推奨: This keyword will be removed in a future version. The main mesh always has priority with VTK 9.5.0 or later.

progress_barbool, default: False

進行状況を示す進行状況バーを表示します.

戻り値:
pyvista.DataSet

データセットのすべてのアイテムが pyvista.PolyData であれば pyvista.PolyData を,そうでなければ pyvista.UnstructuredGrid を返します.

2つのポリデータデータセットをマージします.

>>> import pyvista as pv
>>> sphere = pv.Sphere(center=(0, 0, 1))
>>> cube = pv.Cube()
>>> mesh = pv.merge([cube, sphere])
>>> mesh.plot()
../../../_images/pyvista-merge-1_00_00.png