Remeshing#
Uniform remeshing via the ACVD (Approximate Centroidal Voronoi Diagram) clustering algorithm. Given a target number of clusters, the algorithm redistributes mesh vertices to produce a more uniform cell distribution.
The approach is dimension-agnostic and works for any simplicial manifold:
Weight vertices by incident cell areas
Initialize clusters via area-based region growing
Remove spatially isolated cluster regions
Reconstruct a simplified mesh from cluster adjacency
Note
The output mesh may contain a small percentage (~0.5-1%) of non-manifold edges, which is inherent to the face-mapping approach. Higher cluster counts relative to mesh resolution produce better manifold quality.
from physicsnemo.mesh.remeshing import remesh
from physicsnemo.mesh.primitives.surfaces import sphere_icosahedral
mesh = sphere_icosahedral.load(subdivisions=3)
remeshed = remesh(mesh, n_clusters=100)
print(remeshed.n_cells) # approximately 200 triangles