I am using vtkSelectPolyData and vtkClipPolyData for filling (colour) intersection area, but I am getting an error: “vtkSelectPolyData (0x8920590): Can’t follow edge”, and at the end it could not color the area.
How can I solve this issue? Any help would be appreciated.
Make sure your poly data are well connected. A visually connected structure doesn’t necessarily mean an actually connected one for the algorithm to work. I mean you can have duplicate vertexes, a polyline that is actually a series of two-vertex lines, and so on.
This class may be used to preprocess your poly data so you can have topology issues fixed: https://vtk.org/doc/nightly/html/classvtkCleanPolyData.html .
Thank you for your reply.
Actually I am using “vtkCleanPolyData” filter before doing any calculation for finding the intersection. However, still have the same issue. I attached the picture of the problem I am trying to solve. the yellow area is the intersection between the polydata and a cube, but I cannot colour the area with clipping, due to the error I got.
Hmmm… what options did you enable for cleansing the mesh?
Please find part of my code I am trying to use:
cleanedPolydata = vtk.vtkCleanPolyData() cleanedPolydata.SetInputData(BonePolyData) cleanedPolydata.Update()
Also, I tried to use cleanPolyDataFilter in the intersected area but still got the same issue.
I guess the problem I have is because of the bone shape, as you could see the intersected are is not on the smooth part of the bone (jagged edge of the bone).
It seems to me that you didn’t enable any options.
I suggest taking a look at the numerous options
vtkCleanPolyData has: https://vtk.org/doc/nightly/html/classvtkCleanPolyData.html .