Skip to content
/ pyacvd Public

Python implementation of surface mesh resampling algorithm ACVD

License

Notifications You must be signed in to change notification settings

pyvista/pyacvd

Repository files navigation

pyacvd

This module takes a surface mesh and returns a uniformly meshed surface using voronoi clustering. This approach is loosely based on research by S. Valette, and J. M. Chassery in ACVD.

Installation

Installation is straightforward using pip:

$ pip install pyacvd

Example

This example remeshes a non-uniform quad mesh into a uniform triangular mesh.

from pyvista import examples
import pyacvd

# download cow mesh
cow = examples.download_cow()

# plot original mesh
cow.plot(show_edges=True, color='w')

original cow mesh

zoomed cow mesh

clus = pyacvd.Clustering(cow)
# mesh is not dense enough for uniform remeshing
clus.subdivide(3)
clus.cluster(20000)

# plot clustered cow mesh
clus.plot()

zoomed cow mesh

# remesh
remesh = clus.create_mesh()

# plot uniformly remeshed cow
remesh.plot(color='w', show_edges=True)

zoomed cow mesh