注釈
Go to the end をクリックすると完全なサンプルコードをダウンロードできます.
円形円弧上にスカラーをプロットします#
Interpolate the scalars of a dataset over a circular arc
using plot_over_circular_arc_normal()
.
from __future__ import annotations
import pyvista as pv
from pyvista import examples
ボリュームメッシュ#
高さスカラーを均一な3 Dメッシュに追加します.
mesh = examples.load_uniform()
mesh['height'] = mesh.points[:, 2]
# Make two points at the bounds of the mesh and one at the center to
# construct a circular arc.
normal = [0, 1, 0]
bnds = mesh.bounds
polar = [bnds.x_min, bnds.y_min, bnds.z_max]
center = [bnds.x_min, bnds.y_min, bnds.z_min]
angle = 90.0
# Preview how this circular arc intersects this mesh
# with :func:`~pyvista.CircularArcFromNormal`.
arc = pv.CircularArcFromNormal(center, 100, normal, polar, angle)
p = pv.Plotter()
p.add_mesh(mesh, style='wireframe', color='w')
p.add_mesh(arc, color='b')
a = arc.points[0]
b = arc.points[-1]
p.add_point_labels([a, b], ['A', 'B'], font_size=48, point_color='red', text_color='red')
p.show()

フィルタを実行し,ラインプロットを作成します.
mesh.plot_over_circular_arc_normal(center, 100, normal, polar, angle, 'height')

Total running time of the script: (0 minutes 0.328 seconds)