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: Reduce the number of triangles in a triangular mesh.
  
  It forms a good approximation to the original geometry. Based
  on the algorithm originally described in "Decimation of
  Triangle Meshes", Proc Siggraph 92
  (https://doi.org/10.1145/133994.134010).
  
  Parameters
  ----------
  reduction : float
      Reduction factor. A value of 0.9 will leave 10% of the
      original number of vertices.
  
  feature_angle : float, default: 45.0
      Angle used to define what an edge is (i.e., if the surface
      normal between two adjacent triangles is >= ``feature_angle``,
      an edge exists).
  
  split_angle : float, default: 75.0
      Angle used to control the splitting of the mesh. A split
      line exists when the surface normals between two edge
      connected triangles are >= ``split_angle``.
  
  splitting : bool, default: True
      Controls the splitting of the mesh at corners, along
      edges, at non-manifold points, or anywhere else a split is
      required. Turning splitting off will better preserve the
      original topology of the mesh, but may not necessarily
      give the exact requested decimation.
  
  pre_split_mesh : bool, default: False
      Separates the mesh into semi-planar patches, which are
      disconnected from each other. This can give superior
      results in some cases. If ``pre_split_mesh`` is set to
      ``True``, the mesh is split with the specified
      ``split_angle``. Otherwise mesh splitting is deferred as
      long as possible.
  
  preserve_topology : bool, default: False
      Controls topology preservation. If on, mesh splitting and
      hole elimination will not occur. This may limit the
      maximum reduction that may be achieved.
  
  boundary_vertex_deletion : bool, default: True
      Allow deletion of vertices on the boundary of the mesh.
      Turning this off may limit the maximum reduction that may
      be achieved.
  
  max_degree : float, optional
      The maximum vertex degree. If the number of triangles
      connected to a vertex exceeds ``max_degree``, then the
      vertex will be split. The complexity of the triangulation
      algorithm is proportional to ``max_degree**2``. Setting ``max_degree``
      small can improve the performance of the algorithm.
  
  inplace : bool, default: False
      Whether to update the mesh in-place.
  
  progress_bar : bool, default: False
      Display a progress bar to indicate progress.
  
  Returns
  -------
  pyvista.PolyData
      Decimated mesh.
  
  Examples
  --------
  Decimate a sphere.  First plot the sphere.
  
  >>> import pyvista as pv
  >>> sphere = pv.Sphere(phi_resolution=60, theta_resolution=60)
  >>> sphere.plot(show_edges=True, line_width=2)
  
  Now decimate it and plot it.
  
  >>> decimated = sphere.decimate_pro(0.75)
  >>> decimated.plot(show_edges=True, line_width=2)
  
  See :ref:`decimate_example` for more examples using this filter.
docstr_tok: ["Reduce","the","number","of","triangles","in","a","triangular","mesh",".","It","forms","a","good","approximation","to","the","original","geometry",".","Based","on","the","algorithm","originally","described","in","``","Decimation","of","Triangle","Meshes","''",",","Proc","Siggraph","92","(","https",":","\/\/doi.org\/10.1145\/133994.134010",")",".","Parameters","--","--","--","--","--","reduction",":","float","Reduction","factor",".","A","value","of","0.9","will","leave","10","%","of","the","original","number","of","vertices",".","feature_angle",":","float",",","default",":","45.0","Angle","used","to","define","what","an","edge","is","(","i.e.",",","if","the","surface","normal","between","two","adjacent","triangles","is",">","=","``","feature_angle","``",",","an","edge","exists",")",".","split_angle",":","float",",","default",":","75.0","Angle","used","to","control","the","splitting","of","the","mesh",".","A","split","line","exists","when","the","surface","normals","between","two","edge","connected","triangles","are",">","=","``","split_angle","``",".","splitting",":","bool",",","default",":","True","Controls","the","splitting","of","the","mesh","at","corners",",","along","edges",",","at","non-manifold","points",",","or","anywhere","else","a","split","is","required",".","Turning","splitting","off","will","better","preserve","the","original","topology","of","the","mesh",",","but","may","not","necessarily","give","the","exact","requested","decimation",".","pre_split_mesh",":","bool",",","default",":","False","Separates","the","mesh","into","semi-planar","patches",",","which","are","disconnected","from","each","other",".","This","can","give","superior","results","in","some","cases",".","If","``","pre_split_mesh","``","is","set","to","``","True","``",",","the","mesh","is","split","with","the","specified","``","split_angle","``",".","Otherwise","mesh","splitting","is","deferred","as","long","as","possible",".","preserve_topology",":","bool",",","default",":","False","Controls","topology","preservation",".","If","on",",","mesh","splitting","and","hole","elimination","will","not","occur",".","This","may","limit","the","maximum","reduction","that","may","be","achieved",".","boundary_vertex_deletion",":","bool",",","default",":","True","Allow","deletion","of","vertices","on","the","boundary","of","the","mesh",".","Turning","this","off","may","limit","the","maximum","reduction","that","may","be","achieved",".","max_degree",":","float",",","optional","The","maximum","vertex","degree",".","If","the","number","of","triangles","connected","to","a","vertex","exceeds","``","max_degree","``",",","then","the","vertex","will","be","split",".","The","complexity","of","the","triangulation","algorithm","is","proportional","to","``","max_degree","*","*","2","``",".","Setting","``","max_degree","``","small","can","improve","the","performance","of","the","algorithm",".","inplace",":","bool",",","default",":","False","Whether","to","update","the","mesh","in-place",".","progress_bar",":","bool",",","default",":","False","Display","a","progress","bar","to","indicate","progress",".","Returns","--","--","--","-","pyvista.PolyData","Decimated","mesh",".","Examples","--","--","--","--","Decimate","a","sphere",".","First","plot","the","sphere",".",">",">",">","import","pyvista","as","pv",">",">",">","sphere","=","pv.Sphere","(","phi_resolution=60",",","theta_resolution=60",")",">",">",">","sphere.plot","(","show_edges=True",",","line_width=2",")","Now","decimate","it","and","plot","it",".",">",">",">","decimated","=","sphere.decimate_pro","(","0.75",")",">",">",">","decimated.plot","(","show_edges=True",",","line_width=2",")","See",":","ref",":","`","decimate_example","`","for","more","examples","using","this","filter","."]
code: def decimate_pro(
      self,
      reduction,
      feature_angle=45.0,
      split_angle=75.0,
      splitting=True,
      pre_split_mesh=False,
      preserve_topology=False,
      boundary_vertex_deletion=True,
      max_degree=None,
      inplace=False,
      progress_bar=False,
  ):
      """Reduce the number of triangles in a triangular mesh.
  
      It forms a good approximation to the original geometry. Based
      on the algorithm originally described in "Decimation of
      Triangle Meshes", Proc Siggraph 92
      (https://doi.org/10.1145/133994.134010).
  
      Parameters
      ----------
      reduction : float
          Reduction factor. A value of 0.9 will leave 10% of the
          original number of vertices.
  
      feature_angle : float, default: 45.0
          Angle used to define what an edge is (i.e., if the surface
          normal between two adjacent triangles is >= ``feature_angle``,
          an edge exists).
  
      split_angle : float, default: 75.0
          Angle used to control the splitting of the mesh. A split
          line exists when the surface normals between two edge
          connected triangles are >= ``split_angle``.
  
      splitting : bool, default: True
          Controls the splitting of the mesh at corners, along
          edges, at non-manifold points, or anywhere else a split is
          required. Turning splitting off will better preserve the
          original topology of the mesh, but may not necessarily
          give the exact requested decimation.
  
      pre_split_mesh : bool, default: False
          Separates the mesh into semi-planar patches, which are
          disconnected from each other. This can give superior
          results in some cases. If ``pre_split_mesh`` is set to
          ``True``, the mesh is split with the specified
          ``split_angle``. Otherwise mesh splitting is deferred as
          long as possible.
  
      preserve_topology : bool, default: False
          Controls topology preservation. If on, mesh splitting and
          hole elimination will not occur. This may limit the
          maximum reduction that may be achieved.
  
      boundary_vertex_deletion : bool, default: True
          Allow deletion of vertices on the boundary of the mesh.
          Turning this off may limit the maximum reduction that may
          be achieved.
  
      max_degree : float, optional
          The maximum vertex degree. If the number of triangles
          connected to a vertex exceeds ``max_degree``, then the
          vertex will be split. The complexity of the triangulation
          algorithm is proportional to ``max_degree**2``. Setting ``max_degree``
          small can improve the performance of the algorithm.
  
      inplace : bool, default: False
          Whether to update the mesh in-place.
  
      progress_bar : bool, default: False
          Display a progress bar to indicate progress.
  
      Returns
      -------
      pyvista.PolyData
          Decimated mesh.
  
      Examples
      --------
      Decimate a sphere.  First plot the sphere.
  
      >>> import pyvista as pv
      >>> sphere = pv.Sphere(phi_resolution=60, theta_resolution=60)
      >>> sphere.plot(show_edges=True, line_width=2)
  
      Now decimate it and plot it.
  
      >>> decimated = sphere.decimate_pro(0.75)
      >>> decimated.plot(show_edges=True, line_width=2)
  
      See :ref:`decimate_example` for more examples using this filter.
  
      """
      if not self.is_all_triangles:
          raise NotAllTrianglesError(
              "Input mesh for decimation must be all triangles."
          )
  
      alg = _vtk.vtkDecimatePro()
      alg.SetInputData(self)
      alg.SetTargetReduction(reduction)
      alg.SetPreserveTopology(preserve_topology)
      alg.SetFeatureAngle(feature_angle)
      alg.SetSplitting(splitting)
      alg.SetSplitAngle(split_angle)
      alg.SetPreSplitMesh(pre_split_mesh)
      alg.SetBoundaryVertexDeletion(boundary_vertex_deletion)
  
      if max_degree is not None:
          alg.SetDegree(max_degree)
  
      _update_alg(alg, progress_bar, "Decimating Mesh")
  
      mesh = _get_output(alg)
      if inplace:
          self.copy_from(mesh, deep=False)
          return self
  
      return mesh
  
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 16 for calling the PolyDataFilters obj's underlying member method code with example usage: obj.decimate_pro(reduction, feature_angle, split_angle, splitting, pre_split_mesh, preserve_topology, boundary_vertex_deletion, max_degree, inplace, progress_bar) and returns: mesh, self