class_docstr: An internal class to manage filters/algorithms for polydata datasets.
class_docstr_tok: ["An","internal","class","to","manage","filters\/algorithms","for","polydata","datasets","."]
docstr: Clip a closed polydata surface with a plane.
  
  This currently only supports one plane but could be
  implemented to handle a plane collection.
  
  It will produce a new closed surface by creating new polygonal
  faces where the input data was clipped.
  
  Non-manifold surfaces should not be used as input for this
  filter.  The input surface should have no open edges, and must
  not have any edges that are shared by more than two faces. In
  addition, the input surface should not self-intersect, meaning
  that the faces of the surface should only touch at their
  edges.
  
  Parameters
  ----------
  normal : str, list, optional
      Plane normal to clip with.  Plane is centered at
      ``origin``.  Normal can be either a 3 member list
      (e.g. ``[0, 0, 1]``) or one of the following strings:
      ``'x'``, ``'y'``, ``'z'``, ``'-x'``, ``'-y'``, or
      ``'-z'``.
  
  origin : list, optional
      Coordinate of the origin (e.g. ``[1, 0, 0]``).  Defaults
      to the center of the mesh.
  
  tolerance : float, optional
      The tolerance for creating new points while clipping.  If
      the tolerance is too small, then degenerate triangles
      might be produced.
  
  inplace : bool, default: False
      Updates mesh in-place.
  
  progress_bar : bool, default: False
      Display a progress bar to indicate progress.
  
  Returns
  -------
  pyvista.PolyData
      The clipped mesh.
  
  Examples
  --------
  Clip a sphere in the X direction centered at the origin.  This
  will leave behind half a sphere in the positive X direction.
  
  >>> import pyvista as pv
  >>> sphere = pv.Sphere()
  >>> clipped_mesh = sphere.clip_closed_surface('-z')
  >>> clipped_mesh.plot(show_edges=True, line_width=3)
  
  Clip the sphere at the XY plane and leave behind half the
  sphere in the positive Z direction.  Shift the clip upwards to
  leave a smaller mesh behind.
  
  >>> clipped_mesh = sphere.clip_closed_surface(
  ...     'z', origin=[0, 0, 0.3]
  ... )
  >>> clipped_mesh.plot(show_edges=True, line_width=3)
docstr_tok: ["Clip","a","closed","polydata","surface","with","a","plane",".","This","currently","only","supports","one","plane","but","could","be","implemented","to","handle","a","plane","collection",".","It","will","produce","a","new","closed","surface","by","creating","new","polygonal","faces","where","the","input","data","was","clipped",".","Non-manifold","surfaces","should","not","be","used","as","input","for","this","filter",".","The","input","surface","should","have","no","open","edges",",","and","must","not","have","any","edges","that","are","shared","by","more","than","two","faces",".","In","addition",",","the","input","surface","should","not","self-intersect",",","meaning","that","the","faces","of","the","surface","should","only","touch","at","their","edges",".","Parameters","--","--","--","--","--","normal",":","str",",","list",",","optional","Plane","normal","to","clip","with",".","Plane","is","centered","at","``","origin","``",".","Normal","can","be","either","a","3","member","list","(","e.g",".","``","[","0",",","0",",","1","]","``",")","or","one","of","the","following","strings",":","``","'","x","'","``",",","``","'","y","'","``",",","``","'","z","'","``",",","``","'-x","'","``",",","``","'-y","'","``",",","or","``","'-z","'","``",".","origin",":","list",",","optional","Coordinate","of","the","origin","(","e.g",".","``","[","1",",","0",",","0","]","``",")",".","Defaults","to","the","center","of","the","mesh",".","tolerance",":","float",",","optional","The","tolerance","for","creating","new","points","while","clipping",".","If","the","tolerance","is","too","small",",","then","degenerate","triangles","might","be","produced",".","inplace",":","bool",",","default",":","False","Updates","mesh","in-place",".","progress_bar",":","bool",",","default",":","False","Display","a","progress","bar","to","indicate","progress",".","Returns","--","--","--","-","pyvista.PolyData","The","clipped","mesh",".","Examples","--","--","--","--","Clip","a","sphere","in","the","X","direction","centered","at","the","origin",".","This","will","leave","behind","half","a","sphere","in","the","positive","X","direction",".",">",">",">","import","pyvista","as","pv",">",">",">","sphere","=","pv.Sphere","(",")",">",">",">","clipped_mesh","=","sphere.clip_closed_surface","(","'-z","'",")",">",">",">","clipped_mesh.plot","(","show_edges=True",",","line_width=3",")","Clip","the","sphere","at","the","XY","plane","and","leave","behind","half","the","sphere","in","the","positive","Z","direction",".","Shift","the","clip","upwards","to","leave","a","smaller","mesh","behind",".",">",">",">","clipped_mesh","=","sphere.clip_closed_surface","(","...","'","z","'",",","origin=","[","0",",","0",",","0.3","]","...",")",">",">",">","clipped_mesh.plot","(","show_edges=True",",","line_width=3",")"]
code: def clip_closed_surface(
      self,
      normal="x",
      origin=None,
      tolerance=1e-06,
      inplace=False,
      progress_bar=False,
  ):
      """Clip a closed polydata surface with a plane.
  
      This currently only supports one plane but could be
      implemented to handle a plane collection.
  
      It will produce a new closed surface by creating new polygonal
      faces where the input data was clipped.
  
      Non-manifold surfaces should not be used as input for this
      filter.  The input surface should have no open edges, and must
      not have any edges that are shared by more than two faces. In
      addition, the input surface should not self-intersect, meaning
      that the faces of the surface should only touch at their
      edges.
  
      Parameters
      ----------
      normal : str, list, optional
          Plane normal to clip with.  Plane is centered at
          ``origin``.  Normal can be either a 3 member list
          (e.g. ``[0, 0, 1]``) or one of the following strings:
          ``'x'``, ``'y'``, ``'z'``, ``'-x'``, ``'-y'``, or
          ``'-z'``.
  
      origin : list, optional
          Coordinate of the origin (e.g. ``[1, 0, 0]``).  Defaults
          to the center of the mesh.
  
      tolerance : float, optional
          The tolerance for creating new points while clipping.  If
          the tolerance is too small, then degenerate triangles
          might be produced.
  
      inplace : bool, default: False
          Updates mesh in-place.
  
      progress_bar : bool, default: False
          Display a progress bar to indicate progress.
  
      Returns
      -------
      pyvista.PolyData
          The clipped mesh.
  
      Examples
      --------
      Clip a sphere in the X direction centered at the origin.  This
      will leave behind half a sphere in the positive X direction.
  
      >>> import pyvista as pv
      >>> sphere = pv.Sphere()
      >>> clipped_mesh = sphere.clip_closed_surface('-z')
      >>> clipped_mesh.plot(show_edges=True, line_width=3)
  
      Clip the sphere at the XY plane and leave behind half the
      sphere in the positive Z direction.  Shift the clip upwards to
      leave a smaller mesh behind.
  
      >>> clipped_mesh = sphere.clip_closed_surface(
      ...     'z', origin=[0, 0, 0.3]
      ... )
      >>> clipped_mesh.plot(show_edges=True, line_width=3)
  
      """
      # verify it is manifold
      if self.n_open_edges > 0:
          raise ValueError("This surface appears to be non-manifold.")
      if isinstance(normal, str):
          normal = NORMALS[normal.lower()]
      # find center of data if origin not specified
      if origin is None:
          origin = self.center
  
      # create the plane for clipping
      plane = generate_plane(normal, origin)
      collection = _vtk.vtkPlaneCollection()
      collection.AddItem(plane)
  
      alg = _vtk.vtkClipClosedSurface()
      alg.SetGenerateFaces(True)
      alg.SetInputDataObject(self)
      alg.SetTolerance(tolerance)
      alg.SetClippingPlanes(collection)
      _update_alg(alg, progress_bar, "Clipping Closed Surface")
      result = _get_output(alg)
  
      if inplace:
          self.copy_from(result, deep=False)
          return self
      else:
          return result
  
imports: import collections.abc
  import warnings
  import numpy
  import pyvista
  from pyvista.core import _vtk_core
  from pyvista.core.errors import MissingDataError, NotAllTrianglesError, PyVistaFutureWarning, VTKVersionError
  from pyvista.core.filters import _get_output, _update_alg
  from pyvista.core.filters.data_set import DataSetFilters
  from pyvista.core.utilities.arrays import FieldAssociation, get_array, get_array_association, set_default_active_scalars, vtk_id_list_to_array
  from pyvista.core.utilities.geometric_objects import NORMALS
  from pyvista.core.utilities.helpers import generate_plane, wrap
  from pyvista.core.utilities.misc import abstract_class, assert_empty_kwargs
label_desc: Use image node_id 22 for calling the PolyDataFilters obj's underlying member method code with example usage: obj.clip_closed_surface(normal, origin, tolerance, inplace, progress_bar) and returns: self, result