(pts, color, **kwargs)
return actor
Creates a VTK actor for rendering polygons.

    :param pts: points
    :type pts: vtkFloatArray
    :param color: actor color
    :type color: list
    :return: a VTK actor
    :rtype: vtkActor
Creates a VTK actor for rendering polygons.
Creates a VTK actor for rendering polygons .
def create_actor_polygon(pts, color, **kwargs):
    """ Creates a VTK actor for rendering polygons.

    :param pts: points
    :type pts: vtkFloatArray
    :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)
    line_width = kwargs.get('size', 1.0)

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

    # Number of points
    num_points = points.GetNumberOfPoints()

    # Create lines
    cells = vtk.vtkCellArray()
    for i in range(num_points - 1):
        line = vtk.vtkLine()
        line.GetPointIds().SetId(0, i)
        line.GetPointIds().SetId(1, i + 1)
        cells.InsertNextCell(line)

    # Create a PolyData object and add points & lines
    polydata = vtk.vtkPolyData()
    polydata.SetPoints(points)
    polydata.SetLines(cells)

    # 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)
    actor.GetProperty().SetLineWidth(line_width)

    # Return the actor
    return actor
def create_actor_polygon ( pts , color , * * kwargs ) : # Keyword arguments array_name = kwargs . get ( 'name' , "" ) array_index = kwargs . get ( 'index' , 0 ) line_width = kwargs . get ( 'size' , 1.0 ) # Create points points = vtk . vtkPoints ( ) points . SetData ( pts ) # Number of points num_points = points . GetNumberOfPoints ( ) # Create lines cells = vtk . vtkCellArray ( ) for i in range ( num_points - 1 ) : line = vtk . vtkLine ( ) line . GetPointIds ( ) . SetId ( 0 , i ) line . GetPointIds ( ) . SetId ( 1 , i + 1 ) cells . InsertNextCell ( line ) # Create a PolyData object and add points & lines polydata = vtk . vtkPolyData ( ) polydata . SetPoints ( points ) polydata . SetLines ( cells ) # 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 ) actor . GetProperty ( ) . SetLineWidth ( line_width ) # Return the actor return actor