Hi!
I was trying the newly concretized vtkPointSet class for dense pointcloud analysis and visualization. I wanted to calculate the connectivity of my point cloud using vtkConnectedPointsFilter() but it raises the following error
ERROR:root:Input dataset is not a polydata!
and the RegionId output is empty.
If I use a vtkPolyData the filter runs fine (without defining cell data). Is this behaviour intended, am I doing something wrong or it’s a bug? Why is PolyData needed if this filter does not need the presence of cells?
Steps to reproduce the behaviour:
import vtk
plotter = pv.Plotter()
pc = some_VTK_FLOAT_data
points = vtk.vtkPoints()
points.SetData(pc)
vtk_ps = vtk.vtkPointSet()
vtk_ps.SetPoints(points)
vtk_ps.Modified()
connectivity_filter = vtk.vtkConnectedPointsFilter()
connectivity_filter.SetInputData(vtk_ps)
connectivity_filter.SetRadius(200)
connectivity_filter.SetExtractionModeToAllRegions()
connectivity_filter.Update()
This throws the error.
But when doing
import vtk
plotter = pv.Plotter()
pc = some_VTK_FLOAT_data
points = vtk.vtkPoints()
points.SetData(pc)
vtk_pd= vtk.vtkPolyData()
vtk_pd.SetPoints(points)
vtk_pd.Modified()
connectivity_filter = vtk.vtkConnectedPointsFilter()
connectivity_filter.SetInputData(vtk_pd)
connectivity_filter.SetRadius(200)
connectivity_filter.SetExtractionModeToAllRegions()
connectivity_filter.Update()
it works as intended.
Thanks!