pyFM.viz.to_polydata

pyFM.viz.to_polydata(mesh=None, vertices=None, faces=None, scalars=None)

Convert a mesh to a pyvista.PolyData.

The mesh is given either as an object exposing .vertices (n,3) and .faces (m,3), such as a TriMesh.

Parameters:
  • mesh (object exposing .vertices and .faces. Takes precedence over the) – vertices / faces arguments.

  • vertices (np.ndarray - (n,3) vertex coordinates, used when mesh is None)

  • faces (np.ndarray - (m,3) triangle indices, used when mesh is None. If None, a) – point cloud is built.

  • scalars (np.ndarray - (n|m,) scalar values or (n|m,3) RGB values in [0,1].) – Stored under the name "scalars".

  • Output

  • ------------------------------

  • pv_mesh (pyvista.PolyData)