Geometry (Point Clouds, Meshes and Integration Points)#

The package pysdic provides objects to store and process the geometry of the observed surfaces: point clouds, meshes made of vertices and elements, and integration points located inside the elements. These objects wrap the array-based functions of pysdic.fem and can be converted to and from meshio, pyvista and vtk.

Definition of Notations#

  • \(E\): the dimension of the space (e.g. 2 or 3).

  • \(N_v\), \(N_e\): the number of vertices and elements of a mesh.

  • \(N_{vpe}\): the number of vertices per element.

  • \(K\): the topological dimension of the elements (1 for segments, 2 for triangles and quadrangles).

  • \(N_p\): the number of points (of a point cloud or a set of integration points).

  • \(\Xi = (\xi, \eta, ...)\): the natural coordinates of a point in the reference element.

The supported element types (segment_2, segment_3, triangle_3, triangle_6, quadrangle_4, quadrangle_8) are described in pysdic.fem.

Note

All the objects store their arrays as copies and return read-only views. They can carry properties (one array of shape \((N, \dots)\) per name), accessible with obj.properties or directly with obj[name] (see Core Tools), and can be saved to JSON, HDF5 and NPZ files.

Geometrical objects#

  • PointCloud: A cloud of \(N_p\) points in a space of dimension \(E\), with properties for each point.

  • Connectivity: The \(N_e\) elements of a mesh (vertex indices), with an element type and properties for each element.

  • Mesh: A mesh made of vertices (pysdic.PointCloud) and elements (pysdic.Connectivity), with the finite element operations, the geometry of the elements, the ray casting and the neighborhoods.

  • IntegrationPoints: \(N_p\) points located in the elements of a mesh by their element index and natural coordinates, with weights and properties.

Creating 3D surface meshes#

Create structured surface meshes on a grid of \((n_1, n_2)\) vertices, with a UV map for texturing. The n_* arguments are numbers of vertices, and the surfaces can be placed in any local frame with the frame argument (requires the optional package py3dframe).

Creating 2D surface meshes#

Create structured meshes of planar domains (\(E = 2\)), e.g. for a planar analysis with a camera of the plane or a camera observing the plane \(Z_w = 0\) (see Implemented Extrinsic).

Converting meshes#

  • quadrangle_4_to_triangle_3: Split each quadrangle of a quadrangle_4 mesh into two triangles ("first", "second", "alternate" or "random" diagonal), with the properties and the UV map.

  • triangle_3_to_triangle_6: Convert a triangle_3 mesh into a quadratic triangle_6 mesh (a vertex added at the middle of each edge).

  • quadrangle_4_to_quadrangle_8: Convert a quadrangle_4 mesh into a serendipity quadrangle_8 mesh (a vertex added at the middle of each edge).

Visualization#

  • Plotter3D: Display point clouds, meshes (with properties, textures and vector fields) and integration points with pyvista.

Important

The visualization requires the optional package pyvista (pip install pyvista). The quick_visualize methods of pysdic.PointCloud and pysdic.Mesh give a fast preview without creating a plotter.