LOD and closest neighbour with vtk octree

Hello :smiley:
I am creating a 3D viewer to display large point cloud, I want to add octree structure to my viewer. This octree must allow me :

  • To display the number of level I want
  • To find the closest neighbour point

Is there a vtk class that allows me to have this both functionnality in a single octree structure (according to what I found vtk octree is used to find closest neighbour) or should I use potree library ( or create my own octree algorithm and data structure) ?

Thanks for your help

vtkStaticPointLocator ?

@mwestphal with vtkStaticPointLocator you can locate a point but I also want to choose de LOD to render to optimize performance and according to the documentation this class does not have such a functionnality or maybe I don’t look at the doc correctly

Indeed, LOD would need to be performed using a dedicated filter for LOD.

@mwestphal do you know what kind of filter ? Could I use the same octree with this filter that I create with vtkStaticPointLocator? I am starting to use vtk, it’s not easy to see the power of filters


There are several decimators. Also check out vtkBinnedDecimation (which is similar to what ParaView uses).

1 Like

Paraview uses vtkBinnedDecimation as filter to display LOD ? Because Paraview octrees seem to be very efficient. I should maybe go deeper inside the paraview source code to see how octrees are managed

ParaView use VTKm provided decimator.

@mwestphal So with a decimator filter, LODMapper and LODActor I should be able to have performance equivalent to paraview octree ?

Probable a bit basic for you but some of the octree examples may help e.g. OctreeVisualize, there are nine other examples there.

1 Like

Yes I’ve already seen this example, it displays an octree representation according to the choosen level but you can’t display the corresponding point. I am running through the vtk documentation and examples and honestly for now I’m not totally convinced that using the vtk classes allows me to generate a real octree structure for displaying and finding points.

When I use vtkBinnedDecimation, I get the error “no data to decimate”, is it posible to apply such a decimator with vtkPoints ?

No, it’s a mesh decimation algorithm

If I want to decimate a pointcloud (vtkpoints), is there some vtk tools to do that or should I do that by my own ?