Hello, I am a newcomer to vtk recently. I just encountered a problem. When I show my 3D object in vtk renderer window, I saw a lot of line that connect all vtkPolyData. However, when I extract some features that I want to display on vtk, I dont know how to cancel those lines by code. The prefered vtk display I want is to show my original object with line connecting its points. And the extra feature like the protrusion on the object will be shown without any line connect among them.
Thank you very much.
A picture would help as no lines should connect different polydata together.
Lines don’t automatically connect in VTK. Whatever your code/datafile is (you didn’t post any), it certainly assembled the
vtkPolyData’s geometry to have all de edges you see. There are VTK filters to remove edges with a given characteristic, but you need to give more details on what you have and what you need. Pictures are better for this as suggested above.
This is my vtk picture that I made from a pcl point cloud. Below is my code:
These two function can display the 3D object in vtk. My problem is in the PointCloudToPolyData. I currently know that the messy lines are from the cellarrays and lines I wrote in my code. As a result, I want to ask whether there is any good way to display pointclouds in vtk?
Sorry for the late response. Well, VTK is doing exactly what you’re telling it to do. In the first for loop you add a point and define an edge. This results in a continuous polyline connecting all the points. You have somehow to identify the points that belong to each part and define separate polylines for them. Perhaps dropping the lines entirely, rendering only the points and posting the picture here will help us better to help you to achive what you need.