pyvista.Prop3D.user_matrix

pyvista.Prop3D.user_matrix#

property Prop3D.user_matrix: NumpyArray[float][ソース]#

ユーザー行列を返すか設定します.

position や orientation といったインスタンス変数に加えて,ユーザーはアクタに追加のトランスフォームを追加することができます.

この行列は,アクタが作成されるときに暗黙的に作成されるアクタの内部変換と連結されます.これはアクタ/レンダリングにのみ影響し,入力データ自体には影響しません.

ユーザー マトリックスは,レンダリング前にアクタに適用される最後の変換です.

戻り値:
np.ndarray

4x4 の変換行列.

Apply a 4x4 translation to a wireframe actor. This 4x4 transformation effectively translates the actor by one unit in the Z direction, rotates the actor about the z-axis by approximately 45 degrees, and shrinks the actor by a factor of 0.5.

>>> import pyvista as pv
>>> mesh = pv.Cube()
>>> pl = pv.Plotter()
>>> _ = pl.add_mesh(mesh, color='b')
>>> actor = pl.add_mesh(
...     mesh,
...     color='r',
...     style='wireframe',
...     line_width=5,
...     lighting=False,
... )
>>> arr = [
...     [0.707, -0.707, 0, 0],
...     [0.707, 0.707, 0, 0],
...     [0, 0, 1, 1.5],
...     [0, 0, 0, 2],
... ]
>>> actor.user_matrix = arr
>>> pl.show_axes()
>>> pl.show()
../../../_images/pyvista-Prop3D-user_matrix-1_00_00.png