spateo.tdr.models.models_individual.mesh_utils ============================================== .. py:module:: spateo.tdr.models.models_individual.mesh_utils .. autoapi-nested-parse:: This code contains methods to optimize the final reconstructed mesh model. 1. uniform mesh 2. fix mesh Functions --------- .. autoapisummary:: spateo.tdr.models.models_individual.mesh_utils.uniform_larger_pc spateo.tdr.models.models_individual.mesh_utils.uniform_mesh spateo.tdr.models.models_individual.mesh_utils.smooth_mesh spateo.tdr.models.models_individual.mesh_utils.fix_mesh spateo.tdr.models.models_individual.mesh_utils.clean_mesh Module Contents --------------- .. py:function:: uniform_larger_pc(pc: pyvista.PolyData, alpha: Union[float, int] = 0, nsub: Optional[int] = 5, nclus: int = 20000) -> pyvista.PolyData Generates a uniform point cloud with a larger number of points. If the number of points in the original point cloud is too small or the distribution of the original point cloud is not uniform, making it difficult to construct the surface, this method can be used for preprocessing. :param pc: A point cloud model. :param alpha: Specify alpha (or distance) value to control output of this filter. For a non-zero alpha value, only edges or triangles contained within a sphere centered at mesh vertices will be output. Otherwise, only triangles will be output. :param nsub: Number of subdivisions. Each subdivision creates 4 new triangles, so the number of resulting triangles is nface*4**nsub where nface is the current number of faces. :param nclus: Number of voronoi clustering. :returns: A uniform point cloud with a larger number of points. :rtype: new_pc .. py:function:: uniform_mesh(mesh: pyvista.PolyData, nsub: Optional[int] = 3, nclus: int = 20000) -> pyvista.PolyData Generate a uniformly meshed surface using voronoi clustering. :param mesh: A mesh model. :param nsub: Number of subdivisions. Each subdivision creates 4 new triangles, so the number of resulting triangles is nface*4**nsub where nface is the current number of faces. :param nclus: Number of voronoi clustering. :returns: A uniform mesh model. :rtype: new_mesh .. py:function:: smooth_mesh(mesh: pyvista.PolyData, n_iter: int = 100, **kwargs) -> pyvista.PolyData Adjust point coordinates using Laplacian smoothing. https://docs.pyvista.org/api/core/_autosummary/pyvista.PolyData.smooth.html#pyvista.PolyData.smooth :param mesh: A mesh model. :param n_iter: Number of iterations for Laplacian smoothing. :param \*\*kwargs: The rest of the parameters in pyvista.PolyData.smooth. :returns: A smoothed mesh model. :rtype: smoothed_mesh .. py:function:: fix_mesh(mesh: pyvista.PolyData) -> pyvista.PolyData Repair the mesh where it was extracted and subtle holes along complex parts of the mesh. .. py:function:: clean_mesh(mesh: pyvista.PolyData) -> pyvista.PolyData Removes unused points and degenerate cells.