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: Increase the number of triangles in a triangular mesh based on edge and/or area metrics.
  
  This filter uses a simple case-based, multi-pass approach to
  repeatedly subdivide the input triangle mesh to meet the area
  and/or edge length criteria. New points may be inserted only
  on edges; depending on the number of edges to be subdivided a
  different number of triangles are inserted ranging from two
  (i.e., two triangles replace the original one) to four.
  
  Point and cell data is treated as follows: The cell data from
  a parent triangle is assigned to its subdivided
  children. Point data is interpolated along edges as the edges
  are subdivided.
  
  This filter retains mesh watertightness if the mesh was
  originally watertight; and the area and max triangles criteria
  are not used.
  
  Parameters
  ----------
  max_edge_len : float, optional
      The maximum edge length that a triangle may have. Edges
      longer than this value are split in half and the
      associated triangles are modified accordingly.
  
  max_tri_area : float, optional
      The maximum area that a triangle may have. Triangles
      larger than this value are subdivided to meet this
      threshold. Note that if this criterion is used it may
      produce non-watertight meshes as a result.
  
  max_n_tris : int, optional
      The maximum number of triangles that can be created. If
      the limit is hit, it may result in premature termination
      of the algorithm and the results may be less than
      satisfactory (for example non-watertight meshes may be
      created). By default, the limit is set to a very large
      number (i.e., no effective limit).
  
  max_n_passes : int, optional
      The maximum number of passes (i.e., levels of
      subdivision). If the limit is hit, then the subdivision
      process stops and additional passes (needed to meet other
      criteria) are aborted. The default limit is set to a very
      large number (i.e., no effective limit).
  
  inplace : bool, default: False
      Updates mesh in-place.
  
  progress_bar : bool, default: False
      Display a progress bar to indicate progress.
  
  Returns
  -------
  pyvista.PolyData
      Subdivided mesh.
  
  Examples
  --------
  First, load the example airplane mesh and plot it.
  
  >>> import pyvista as pv
  >>> from pyvista import examples
  >>> mesh = pv.PolyData(examples.planefile)
  >>> mesh.plot(show_edges=True, line_width=3)
  
  Subdivide the mesh
  
  >>> submesh = mesh.subdivide_adaptive(max_n_passes=2)
  >>> submesh.plot(show_edges=True)
docstr_tok: ["Increase","the","number","of","triangles","in","a","triangular","mesh","based","on","edge","and\/or","area","metrics",".","This","filter","uses","a","simple","case-based",",","multi-pass","approach","to","repeatedly","subdivide","the","input","triangle","mesh","to","meet","the","area","and\/or","edge","length","criteria",".","New","points","may","be","inserted","only","on","edges",";","depending","on","the","number","of","edges","to","be","subdivided","a","different","number","of","triangles","are","inserted","ranging","from","two","(","i.e.",",","two","triangles","replace","the","original","one",")","to","four",".","Point","and","cell","data","is","treated","as","follows",":","The","cell","data","from","a","parent","triangle","is","assigned","to","its","subdivided","children",".","Point","data","is","interpolated","along","edges","as","the","edges","are","subdivided",".","This","filter","retains","mesh","watertightness","if","the","mesh","was","originally","watertight",";","and","the","area","and","max","triangles","criteria","are","not","used",".","Parameters","--","--","--","--","--","max_edge_len",":","float",",","optional","The","maximum","edge","length","that","a","triangle","may","have",".","Edges","longer","than","this","value","are","split","in","half","and","the","associated","triangles","are","modified","accordingly",".","max_tri_area",":","float",",","optional","The","maximum","area","that","a","triangle","may","have",".","Triangles","larger","than","this","value","are","subdivided","to","meet","this","threshold",".","Note","that","if","this","criterion","is","used","it","may","produce","non-watertight","meshes","as","a","result",".","max_n_tris",":","int",",","optional","The","maximum","number","of","triangles","that","can","be","created",".","If","the","limit","is","hit",",","it","may","result","in","premature","termination","of","the","algorithm","and","the","results","may","be","less","than","satisfactory","(","for","example","non-watertight","meshes","may","be","created",")",".","By","default",",","the","limit","is","set","to","a","very","large","number","(","i.e.",",","no","effective","limit",")",".","max_n_passes",":","int",",","optional","The","maximum","number","of","passes","(","i.e.",",","levels","of","subdivision",")",".","If","the","limit","is","hit",",","then","the","subdivision","process","stops","and","additional","passes","(","needed","to","meet","other","criteria",")","are","aborted",".","The","default","limit","is","set","to","a","very","large","number","(","i.e.",",","no","effective","limit",")",".","inplace",":","bool",",","default",":","False","Updates","mesh","in-place",".","progress_bar",":","bool",",","default",":","False","Display","a","progress","bar","to","indicate","progress",".","Returns","--","--","--","-","pyvista.PolyData","Subdivided","mesh",".","Examples","--","--","--","--","First",",","load","the","example","airplane","mesh","and","plot","it",".",">",">",">","import","pyvista","as","pv",">",">",">","from","pyvista","import","examples",">",">",">","mesh","=","pv.PolyData","(","examples.planefile",")",">",">",">","mesh.plot","(","show_edges=True",",","line_width=3",")","Subdivide","the","mesh",">",">",">","submesh","=","mesh.subdivide_adaptive","(","max_n_passes=2",")",">",">",">","submesh.plot","(","show_edges=True",")"]
code: def subdivide_adaptive(
      self,
      max_edge_len=None,
      max_tri_area=None,
      max_n_tris=None,
      max_n_passes=None,
      inplace=False,
      progress_bar=False,
  ):
      """Increase the number of triangles in a triangular mesh based on edge and/or area metrics.
  
      This filter uses a simple case-based, multi-pass approach to
      repeatedly subdivide the input triangle mesh to meet the area
      and/or edge length criteria. New points may be inserted only
      on edges; depending on the number of edges to be subdivided a
      different number of triangles are inserted ranging from two
      (i.e., two triangles replace the original one) to four.
  
      Point and cell data is treated as follows: The cell data from
      a parent triangle is assigned to its subdivided
      children. Point data is interpolated along edges as the edges
      are subdivided.
  
      This filter retains mesh watertightness if the mesh was
      originally watertight; and the area and max triangles criteria
      are not used.
  
      Parameters
      ----------
      max_edge_len : float, optional
          The maximum edge length that a triangle may have. Edges
          longer than this value are split in half and the
          associated triangles are modified accordingly.
  
      max_tri_area : float, optional
          The maximum area that a triangle may have. Triangles
          larger than this value are subdivided to meet this
          threshold. Note that if this criterion is used it may
          produce non-watertight meshes as a result.
  
      max_n_tris : int, optional
          The maximum number of triangles that can be created. If
          the limit is hit, it may result in premature termination
          of the algorithm and the results may be less than
          satisfactory (for example non-watertight meshes may be
          created). By default, the limit is set to a very large
          number (i.e., no effective limit).
  
      max_n_passes : int, optional
          The maximum number of passes (i.e., levels of
          subdivision). If the limit is hit, then the subdivision
          process stops and additional passes (needed to meet other
          criteria) are aborted. The default limit is set to a very
          large number (i.e., no effective limit).
  
      inplace : bool, default: False
          Updates mesh in-place.
  
      progress_bar : bool, default: False
          Display a progress bar to indicate progress.
  
      Returns
      -------
      pyvista.PolyData
          Subdivided mesh.
  
      Examples
      --------
      First, load the example airplane mesh and plot it.
  
      >>> import pyvista as pv
      >>> from pyvista import examples
      >>> mesh = pv.PolyData(examples.planefile)
      >>> mesh.plot(show_edges=True, line_width=3)
  
      Subdivide the mesh
  
      >>> submesh = mesh.subdivide_adaptive(max_n_passes=2)
      >>> submesh.plot(show_edges=True)
  
      """
      if not self.is_all_triangles:
          raise NotAllTrianglesError(
              "Input mesh for subdivision must be all triangles."
          )
  
      sfilter = _vtk.vtkAdaptiveSubdivisionFilter()
      if max_edge_len:
          sfilter.SetMaximumEdgeLength(max_edge_len)
      if max_tri_area:
          sfilter.SetMaximumTriangleArea(max_tri_area)
      if max_n_tris:
          sfilter.SetMaximumNumberOfTriangles(max_n_tris)
      if max_n_passes:
          sfilter.SetMaximumNumberOfPasses(max_n_passes)
  
      sfilter.SetInputData(self)
      _update_alg(sfilter, progress_bar, "Adaptively Subdividing Mesh")
      submesh = _get_output(sfilter)
  
      if inplace:
          self.copy_from(submesh, deep=False)
          return self
  
      return submesh
  
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 19 for calling the PolyDataFilters obj's underlying member method code with example usage: obj.subdivide_adaptive(max_edge_len, max_tri_area, max_n_tris, max_n_passes, inplace, progress_bar) and returns: submesh, self