Closed lassoan closed 1 year ago
A pyvista.PolyData
object is a vtk.vtkPolyData
object. If using this package, PyVista is installed as it is a dependency so wrapping your already existing vtkPolyData object is a one-liner via pyvista.wrap()
.
If your mesh is currently a vtkPolyData
instance, simply:
import vtk
import pyvista as pv
import pyacvd
mesh = ... # this is vtkPolyData
wrapped = pv.wrap(mesh)
clus = pyacvd.Clustering(wrapped)
clus.subdivide(3)
clus.cluster(20000)
# remesh
remesh = clus.create_mesh() # returns pyvista.PolyData
# Sanity check that pyvista.PolyData is vtkPolyData
assert isinstance(remesh, vtk.vtkPolyData)
Thanks for responding here @banesullivan
Thank you for providing this package! How can I use this package if I have the input as vtkPolyData and would need the processed mesh as vtkPolyData? All the examples use some pyvista mesh objects and I don't know how to convert those to/from vtkPolyData.