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: Extrude polygonal data trimmed by a surface.
  
  The input dataset is swept along a specified direction forming a
  "skirt" from the boundary edges 2D primitives (i.e., edges used
  by only one polygon); and/or from vertices and lines. The extent
  of the sweeping is defined where the sweep intersects a
  user-specified surface.
  
  Parameters
  ----------
  direction : numpy.ndarray or sequence
      Direction vector to extrude.
  
  trim_surface : pyvista.PolyData
      Surface which trims the surface.
  
  extrusion : str, default: "boundary_edges"
      Control the strategy of extrusion. One of the following:
  
      * ``"boundary_edges"``
      * ``"all_edges"``
  
      The default only generates faces on the boundary of the original
      input surface. When using ``"all_edges"``, faces are created along
      interior points as well.
  
  capping : str, default: "intersection"
      Control the strategy of capping. One of the following:
  
      * ``"intersection"``
      * ``"minimum_distance"``
      * ``"maximum_distance"``
      * ``"average_distance"``
  
  inplace : bool, default: False
      Overwrites the original mesh in-place.
  
  progress_bar : bool, default: False
      Display a progress bar to indicate progress.
  
  Returns
  -------
  pyvista.PolyData
      Extruded mesh trimmed by a surface.
  
  Examples
  --------
  Extrude a disc.
  
  >>> import pyvista as pv
  >>> import numpy as np
  >>> plane = pv.Plane(i_size=2, j_size=2, direction=[0, 0.8, 1])
  >>> disc = pv.Disc(center=(0, 0, -1), c_res=50)
  >>> direction = [0, 0, 1]
  >>> extruded_disc = disc.extrude_trim(direction, plane)
  >>> extruded_disc.plot(smooth_shading=True, split_sharp_edges=True)
docstr_tok: ["Extrude","polygonal","data","trimmed","by","a","surface",".","The","input","dataset","is","swept","along","a","specified","direction","forming","a","''","skirt","''","from","the","boundary","edges","2D","primitives","(","i.e.",",","edges","used","by","only","one","polygon",")",";","and\/or","from","vertices","and","lines",".","The","extent","of","the","sweeping","is","defined","where","the","sweep","intersects","a","user-specified","surface",".","Parameters","--","--","--","--","--","direction",":","numpy.ndarray","or","sequence","Direction","vector","to","extrude",".","trim_surface",":","pyvista.PolyData","Surface","which","trims","the","surface",".","extrusion",":","str",",","default",":","``","boundary_edges","''","Control","the","strategy","of","extrusion",".","One","of","the","following",":","*","``","``","boundary_edges","''","``","*","``","``","all_edges","''","``","The","default","only","generates","faces","on","the","boundary","of","the","original","input","surface",".","When","using","``","``","all_edges","''","``",",","faces","are","created","along","interior","points","as","well",".","capping",":","str",",","default",":","``","intersection","''","Control","the","strategy","of","capping",".","One","of","the","following",":","*","``","``","intersection","''","``","*","``","``","minimum_distance","''","``","*","``","``","maximum_distance","''","``","*","``","``","average_distance","''","``","inplace",":","bool",",","default",":","False","Overwrites","the","original","mesh","in-place",".","progress_bar",":","bool",",","default",":","False","Display","a","progress","bar","to","indicate","progress",".","Returns","--","--","--","-","pyvista.PolyData","Extruded","mesh","trimmed","by","a","surface",".","Examples","--","--","--","--","Extrude","a","disc",".",">",">",">","import","pyvista","as","pv",">",">",">","import","numpy","as","np",">",">",">","plane","=","pv.Plane","(","i_size=2",",","j_size=2",",","direction=","[","0",",","0.8",",","1","]",")",">",">",">","disc","=","pv.Disc","(","center=","(","0",",","0",",","-1",")",",","c_res=50",")",">",">",">","direction","=","[","0",",","0",",","1","]",">",">",">","extruded_disc","=","disc.extrude_trim","(","direction",",","plane",")",">",">",">","extruded_disc.plot","(","smooth_shading=True",",","split_sharp_edges=True",")"]
code: def extrude_trim(
      self,
      direction,
      trim_surface,
      extrusion="boundary_edges",
      capping="intersection",
      inplace=False,
      progress_bar=False,
  ):
      """Extrude polygonal data trimmed by a surface.
  
      The input dataset is swept along a specified direction forming a
      "skirt" from the boundary edges 2D primitives (i.e., edges used
      by only one polygon); and/or from vertices and lines. The extent
      of the sweeping is defined where the sweep intersects a
      user-specified surface.
  
      Parameters
      ----------
      direction : numpy.ndarray or sequence
          Direction vector to extrude.
  
      trim_surface : pyvista.PolyData
          Surface which trims the surface.
  
      extrusion : str, default: "boundary_edges"
          Control the strategy of extrusion. One of the following:
  
          * ``"boundary_edges"``
          * ``"all_edges"``
  
          The default only generates faces on the boundary of the original
          input surface. When using ``"all_edges"``, faces are created along
          interior points as well.
  
      capping : str, default: "intersection"
          Control the strategy of capping. One of the following:
  
          * ``"intersection"``
          * ``"minimum_distance"``
          * ``"maximum_distance"``
          * ``"average_distance"``
  
      inplace : bool, default: False
          Overwrites the original mesh in-place.
  
      progress_bar : bool, default: False
          Display a progress bar to indicate progress.
  
      Returns
      -------
      pyvista.PolyData
          Extruded mesh trimmed by a surface.
  
      Examples
      --------
      Extrude a disc.
  
      >>> import pyvista as pv
      >>> import numpy as np
      >>> plane = pv.Plane(i_size=2, j_size=2, direction=[0, 0.8, 1])
      >>> disc = pv.Disc(center=(0, 0, -1), c_res=50)
      >>> direction = [0, 0, 1]
      >>> extruded_disc = disc.extrude_trim(direction, plane)
      >>> extruded_disc.plot(smooth_shading=True, split_sharp_edges=True)
  
      """
      if (
          not isinstance(
              direction, (np.ndarray, collections.abc.Sequence)
          )
          or len(direction) != 3
      ):
          raise TypeError("Vector must be a length three vector")
  
      extrusions = {"boundary_edges": 0, "all_edges": 1}
      if isinstance(extrusion, str):
          if extrusion not in extrusions:
              raise ValueError(
                  f'Invalid strategy of extrusion "{extrusion}".'
              )
          extrusion = extrusions[extrusion]
      else:
          raise TypeError(
              "Invalid type given to `extrusion`. Must be a string."
          )
  
      cappings = {
          "intersection": 0,
          "minimum_distance": 1,
          "maximum_distance": 2,
          "average_distance": 3,
      }
      if isinstance(capping, str):
          if capping not in cappings:
              raise ValueError(
                  f'Invalid strategy of capping "{capping}".'
              )
          capping = cappings[capping]
      else:
          raise TypeError(
              "Invalid type given to `capping`. Must be a string."
          )
  
      alg = _vtk.vtkTrimmedExtrusionFilter()
      alg.SetInputData(self)
      alg.SetExtrusionDirection(*direction)
      alg.SetTrimSurfaceData(trim_surface)
      alg.SetExtrusionStrategy(extrusion)
      alg.SetCappingStrategy(capping)
      _update_alg(alg, progress_bar, "Extruding with trimming")
      output = wrap(alg.GetOutput())
      if inplace:
          self.copy_from(output, deep=False)
          return self
      return output
  
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 39 for calling the PolyDataFilters obj's underlying member method code with example usage: obj.extrude_trim(direction, trim_surface, extrusion, capping, inplace, progress_bar) and returns: output, self