pysdic.Mesh.vertices#

property Mesh.vertices: PointCloud#

[Get or Set] The vertices of the mesh in an PointCloud instance.

The vertices are represented as a PointCloud instance with shape (\(N_v\), \(E\)) where \(N_v\) is the number of vertices and \(E\) is the embedding dimension.

Note

This property is settable.

Warning

If the vertices are changed, the connectivity and properties may become invalid. Please ensure to recompute or update them accordingly.

To change the number of vertices, it is recommended to create a new Mesh instance with the updated vertices and connectivity rather than modifying the vertices in place. For memory considerations, you can also modify the vertices in place, but please ensure that all necessary checks are performed before using this mode.

Parameters:

value (Union[PointCloud, ArrayLike]) – The new vertices for the mesh with shape (\(N_v\), \(E\)).

Returns:

The vertices of the mesh as a PointCloud instance of shape (\(N_v\), \(E\)).

Return type:

PointCloud

Examples

Create a simple Mesh instance.

1import numpy as np
2from pysdic import Mesh, PointCloud
3
4points = np.array([[0, 0, 0], [1, 0, 0], [0, 1, 0], [0, 0, 1]])
5connectivity = np.array([[0, 1, 2], [0, 1, 3], [0, 2, 3], [1, 2, 3]])
6mesh3d = Mesh(points, connectivity, element_type="triangle_3")

Access the vertices of the mesh.

print(mesh3d.vertices)
# Output: PointCloud with 4 points [[0, 0, 0], [1, 0, 0], [0, 1, 0], [0, 0, 1]]