Hi, I have a polygonal mesh which when I load in paraview or programmaticlly load in vtk, the number of cells(23336) is found higher than the number of points(11754). This is confusing to me because as I understand the cells are like containers which can store starting from vertex, polyvertex, line, polyline, triangles etc. Why or when the number of cells becomes higher than the number of points?
There’s no reason why the number of cells should be less than the number of points. For example your mesh could contain triangles, lines at the edges of each triangle, and vertices at each corner of the triangle. It all depends on what is in your input.
it is possible that you have both polygonal face cells and vertice cells in the mesh. When plotting do you see the nodes? If so, then you have both cell types.
Here’s an example using PyVista:
import pyvista as pv import numpy as np vertices = np.array([[0,0,0], [0,1,0], [1,0,0], [1,1,0]]) faces = np.array([[3, 0, 1, 2], [3, 1, 2, 3]]) # Create mesh with vertice cells mesh = pv.PolyData(vertices) # add faces because PolyData treats vertices and faces seperately mesh.faces = faces mesh.plot(show_edges=True, point_size=20, cpos='xy')
>>> mesh.n_cells > mesh.n_points True
Thank you so much Bane!!
It is very clear for me now.