pyvista.PolyData.n_verts#
- property PolyData.n_verts: int[ソース]#
Return the number of vertex cells.
This is the total number of
VERTEXandPOLY_VERTEXcells defined in thevertsconnectivity array.注釈
The number of vertices is separate and distinct from
n_points, as it's possible forPolyDatato havepointsbut noverts.参考
vertsn_lines,n_faces_strict,n_stripsNumber of cells in other connectivity arrays.
pyvista.DataSet.n_cells,pyvista.DataSet.n_pointsNumber of total cells and points in this mesh.
例
Create a simple mesh containing just two points and return the number of vertices and cells. By default, when constructing a PolyData with points but no cells, vertices are automatically created, one per point.
>>> import pyvista as pv >>> mesh = pv.PolyData([[1.0, 0.0, 0.0], [1.0, 1.0, 1.0]]) >>> mesh.n_points, mesh.n_verts, mesh.n_cells (2, 2, 2)
他のセルが指定された場合,これらの頂点は作成されません.
>>> import pyvista as pv >>> mesh = pv.PolyData([[1.0, 0.0, 0.0], [1.0, 1.0, 1.0]], lines=[2, 0, 1]) >>> mesh.n_points, mesh.n_verts, mesh.n_cells (2, 0, 1)