(pts, tris, color, **kwargs)
return actor
Creates a VTK actor for rendering triangulated surface plots.

    :param pts: points
    :type pts: vtkFloatArray
    :param tris: list of triangle indices
    :type tris: ndarray
    :param color: actor color
    :type color: list
    :return: a VTK actor
    :rtype: vtkActor
Creates a VTK actor for rendering triangulated surface plots.
Creates a VTK actor for rendering triangulated surface plots .
def create_actor_tri(pts, tris, color, **kwargs):
    """ Creates a VTK actor for rendering triangulated surface plots.

    :param pts: points
    :type pts: vtkFloatArray
    :param tris: list of triangle indices
    :type tris: ndarray
    :param color: actor color
    :type color: list
    :return: a VTK actor
    :rtype: vtkActor
    """
    # Keyword arguments
    array_name = kwargs.get('name', "")
    array_index = kwargs.get('index', 0)

    # Create points
    points = vtk.vtkPoints()
    points.SetData(pts)

    # Create triangles
    triangles = vtk.vtkCellArray()
    for tri in tris:
        tmp = vtk.vtkTriangle()
        for i, v in enumerate(tri):
            tmp.GetPointIds().SetId(i, v)
        triangles.InsertNextCell(tmp)

    # Create a PolyData object and add points & triangles
    polydata = vtk.vtkPolyData()
    polydata.SetPoints(points)
    polydata.SetPolys(triangles)

    # Map poly data to the graphics primitives
    mapper = vtk.vtkPolyDataMapper()
    mapper.SetInputDataObject(polydata)
    mapper.SetArrayName(array_name)
    mapper.SetArrayId(array_index)

    # Create an actor and set its properties
    actor = vtk.vtkActor()
    actor.SetMapper(mapper)
    actor.GetProperty().SetColor(*color)

    # Return the actor
    return actor
def create_actor_tri ( pts , tris , color , * * kwargs ) : # Keyword arguments array_name = kwargs . get ( 'name' , "" ) array_index = kwargs . get ( 'index' , 0 ) # Create points points = vtk . vtkPoints ( ) points . SetData ( pts ) # Create triangles triangles = vtk . vtkCellArray ( ) for tri in tris : tmp = vtk . vtkTriangle ( ) for i , v in enumerate ( tri ) : tmp . GetPointIds ( ) . SetId ( i , v ) triangles . InsertNextCell ( tmp ) # Create a PolyData object and add points & triangles polydata = vtk . vtkPolyData ( ) polydata . SetPoints ( points ) polydata . SetPolys ( triangles ) # Map poly data to the graphics primitives mapper = vtk . vtkPolyDataMapper ( ) mapper . SetInputDataObject ( polydata ) mapper . SetArrayName ( array_name ) mapper . SetArrayId ( array_index ) # Create an actor and set its properties actor = vtk . vtkActor ( ) actor . SetMapper ( mapper ) actor . GetProperty ( ) . SetColor ( * color ) # Return the actor return actor