code: def loadPolyData(filename):
      
      if not os.path.exists(filename):
          colors.printc("~noentry Error in loadPolyData: Cannot find", filename, c=1)
          return None
      fl = filename.lower()
      if   fl.endswith(".vtk"):
          reader = vtk.vtkPolyDataReader()
      elif fl.endswith(".ply"):
          reader = vtk.vtkPLYReader()
      elif fl.endswith(".obj"):
          reader = vtk.vtkOBJReader()
      elif fl.endswith(".stl"):
          reader = vtk.vtkSTLReader()
      elif fl.endswith(".byu") or fl.endswith(".g"):
          reader = vtk.vtkBYUReader()
      elif fl.endswith(".vtp"):
          reader = vtk.vtkXMLPolyDataReader()
      elif fl.endswith(".vts"):
          reader = vtk.vtkXMLStructuredGridReader()
      elif fl.endswith(".vtu"):
          reader = vtk.vtkXMLUnstructuredGridReader()
      elif fl.endswith(".txt"):
          reader = vtk.vtkParticleReader()  # (x y z scalar)
      elif fl.endswith(".xyz"):
          reader = vtk.vtkParticleReader()
      else:
          reader = vtk.vtkDataReader()
      reader.SetFileName(filename)
      if fl.endswith(".vts"):  # structured grid
          reader.Update()
          gf = vtk.vtkStructuredGridGeometryFilter()
          gf.SetInputConnection(reader.GetOutputPort())
          gf.Update()
          poly = gf.GetOutput()
      elif fl.endswith(".vtu"):  # unstructured grid
          reader.Update()
          gf = vtk.vtkGeometryFilter()
          gf.SetInputConnection(reader.GetOutputPort())
          gf.Update()
          poly = gf.GetOutput()
      else:
          try:
              reader.Update()
              poly = reader.GetOutput()
          except:
              poly = None
  
      if not poly:
          return None
  
      cleanpd = vtk.vtkCleanPolyData()
      cleanpd.SetInputData(poly)
      cleanpd.Update()
      return cleanpd.GetOutput()
docs: Load a file and return a ``vtkPolyData`` object (not a ``vtkActor``).