pyvista.examples.cells.plot_cell

目次

pyvista.examples.cells.plot_cell#

plot_cell(
grid: PolyData | UnstructuredGrid,
cpos=None,
*,
line_width: int | None = None,
point_size: int | None = None,
font_size: int | None = None,
show_normals: bool = False,
normals_scale: float | None = None,
**kwargs,
)[ソース]#

Plot a mesh while displaying cell indices.

バージョン 0.45 で変更: The default line width, point size, and font size are increased from 5, 30 and 20 to 10, 80, and 50, respectively.

バージョン 0.47 で変更: The default line width, point size, and font size are restored to their original values prior to version 0.45. These values can now be customized with keywords.

パラメータ:
gridPolyData | UnstructuredGrid

Dataset containing one single cell (ideally), though plotting a mesh with multiple cells is supported.

バージョン 0.47 で変更: Plotting PolyData is now supported.

cposstr, optional

カメラの位置.

line_widthint, default: 5

Line width of the cell's edges.

Added in version 0.47.

point_sizeint, default: 30

Size of the cell's points.

Added in version 0.47.

font_sizeint, default: 20

Size of the point labels.

Added in version 0.47.

show_normalsbool, optional

Show the face normals of the cell. Only applies to 2D or 3D cells. Cell faces with correct orientation should have the normal pointing outward.

The size of the normals is controlled by normals_scale.

Added in version 0.47.

normals_scalefloat, default: 0.1

Scale factor used when show_normals is enabled. The normals are scaled proportional to the diagonal length of the input grid.

Added in version 0.47.

**kwargsdict, optional

表示する際の追加のキーワード引数です. pyvista.Plotter.show() を参照してください.

6面体を1つ作り,プロットします.

>>> from pyvista import examples
>>> grid = examples.cells.Hexahedron()
>>> examples.plot_cell(grid)
../../../_images/pyvista-examples-cells-plot_cell-6553cf38f17755fe_00_00.png

Show normals and customize the size of various elements in the rendering.

>>> examples.plot_cell(
...     grid,
...     show_normals=True,
...     normals_scale=0.2,
...     line_width=8,
...     point_size=50,
...     font_size=30,
... )
../../../_images/pyvista-examples-cells-plot_cell-6553cf38f17755fe_01_00.png