mesh.Mesh.remesh#
- Mesh.remesh(n_points=-1, subdivisions=3)#
Remesh a triangle Mesh.
Parameters#
- npoints: int, optional
The approximat number of vertices in the output mesh. If negative (default), it is set to the number of vertices in the input Mesh.
- subdivisions: int, optional
The number of subdivisions to be created in order to have a finer mesh for the clustering method. A higher number results in a more regular mesh, at the expense of a longer computation time.
Important
This operation may result in a non-manifold surface mesh. It is always recommended to visually inspect the result, and check the resulting mesh using
check_triangle_mesh(). If needed, you can attempt to repair the mesh withfix_triangle_mesh().Returns#
- Mesh
Returns a resampled triangle Mesh.
Examples#
>>> cube = Mesh(eltype='hex8').border_mesh().convert('tri3') >>> cube_remeshed = cube.remesh(n_points=100, subdivisions=10) >>> print(cube_remeshed.n_points()) 100
>>> sphere = shapes.sphere() >>> print(sphere.n_points()) 614 >>> sphere_remeshed = sphere.remesh(subdivisions=5) >>> print(sphere_remeshed.n_points()) 614