Extract Points in vtkPolyData based on Distance

Hey Folks!

I am trying to make a visualization of surfaces in 3D. These surfaces are defined by moving lines in time. which are extracted numerically. The problem i have is not creating a surface from the extracted lines (e.g. with Delaunay 2D or by connecting them with a Python script) but to distinguish between different lines/surfaces.

Is there any VTK (or Paraview) Filter which is able to extract points (or lines) by distance? Then i can easily triangulate the points of the polylines. But right now i struggle to find a way to distinguish between two surfaces. As an example see the picture below

These are two surfaces which i would like to create the meshes from. The distance between lines of the same surface can be made arbitrary small, as they are created by a smoothly varying parameter.

Unfortunately i can only extract the lines at once. Making it even worse, there is an unclear amount of lines apparent in the domain at different times. So i am urgently in the need to find a way to decide which lines belong together, at best only based on the distance between lines / points (or any other suitable method to achieve my goal of course). I have searched the forums for two weeks and tried everything which lays in my power but i have not succeeded or found anything useful until yet. So i would appreciate any kind of help!

Thanks a lot in advance!

If you are creating the lines I think you could add an scalar array to each one with its ID value (that you’d count starting from 0). Then maybe you could try vtkThreshold to extract the adjacent lines you want.

Hope it helps but I’m not sure I understood your problem correctly

Hey thanks for your answer! And sorry for the confusion…

The problem is that from the lines above i want to create two surfaces with a gap in the middle. These surfaces are defined by two moving lines. So in principle i have parametric surfaces. However, the lines are computed numerically (based on a vector field but unrelated to the problem i guess). So in the example above i can only extract two lines at once every time step. I do not want to connect these two lines because they belong to different surfaces. But i want to connect the lines/points which are generated by the two extracted lines moving in space and time. But everything sits in one single vtkPolyData object.

Its true, i could add an ID to each time step, but that would (as far as i understand) not solve the problem of distinguishing between the two lines / surfaces. Sure i could also use the cell ID to decide which line, but what happens if, lets say, at time step T_max/2 there is another line appearing. How is this reflected in vtkPolyData? Will it just get added at the end? What happens if some other line disappears? With some noise at each time step the indexing of the PolyData will completely change.

The only way i see a solution to this problem is to classify the points by distance to its neighbors. If, lets say, the distance of a point is smaller than a certain threshold to another point, they get but into an class. I think this is some kind of clustering task, but without prior knowledge about the number of clusters to find. I know there is a KMeans Filter in Paraview but to be honest i don’t know how to use it and if it would really solve my problem.