pyprocar.core.Surface#

class pyprocar.core.Surface(verts: ndarray | None = None, faces: ndarray | None = None, face_normals: ndarray | None = None, vert_normals: ndarray | None = None, face_colors: ndarray | None = None, vert_colors: ndarray | None = None, vectors: ndarray | None = None, scalars: ndarray | None = None)[source]#

Surface is a class that holds information about a surface. This class inherits from the pyvista.PolyData class. To create a surface the minimum requirements are verts and faces

Parameters:
  • verts (list of float (nverts,3)) – The list of verticies that create the surface.

  • faces (list of integers (nfaces,3)) – The default is None. The list of connectivity between verts that create the surface.

  • face_normals (list of float (nfaces,3)) – The list of normal vectors to each face.

  • vert_normals (list of float (nverts,3)) – The list of normal vectors to each vertex.

  • face_colors (list of tuples floats (nfaces,3)) – The list of colors of each face. example:face_colors=[(1,0,0),(1,0.5,0),...,(1,0,0)]

  • vert_colors (list of tuples floats (nfaces,3)) – The list of colors of each vertex.

  • vectors (list of floats (nfaces,3)) – The list of vectors one wants to attach to the surface(glyphs) Only useful in pyvista objects

  • scalars (list of floats (nfaces,)) – The list of scalars for each face. This can represent the color using a color map

Methods

Surface.__init__([verts, faces, ...])

Initialize the polydata.

Surface.export([file_obj, file_type])

This function uses the export function from trimesh

Surface.set_color_with_cmap([cmap, vmin, vmax])

Sets colors for the trimesh object using the color map provided

Surface.set_scalars(scalars[, scalar_name])

Sets/Updates the scalars of the surface.

Surface.set_vectors(vectors_X, vectors_Y, ...)

Sets/Updates the vectors of the surface.

Attributes

Surface.centers

Centers of faces

Surface.faces_array

The faces listed in a list of list which contains the faces.