Keep only edges that create a closed loop

Hi,

I have an output from vtkFeatureEdges, only keeping the boundary edges. See picture below:

I’d like to able to create a planar face for the closed yellow loop inside the to keep red marker.

I’ve tried vtkStripper and vtkFillHolesFilter without success. Any advice? Here is the file
example.vtk (17.6 KB)

Thank you

If it’s planar, the vtkContourTriangulator should be able to do it. With or without vtkStripper as a preliminary step.

Ah, in my first answer I think I misunderstood your question. If you’re wondering about how to remove the “legs” and keep the loop, I’m not sure how to do that with VTK.

Yes, that was what I was asking. Thank you

To give more context, that polydata was derived from an attempt to be able to do something like vtkClipClosedSurface on a pipeline. The only problem is that vtkClipClosedSurface only supports the boolean intersection of the input planeCollection (and it does not support union or difference boolean operations)

If you want to get just one face from vtkClipClosedSurface, you can use SetScalarModeToLabels() and then use another filter to extract only the cells that it labeled as the cut face. For example, I think vtkPolyDataConnectivityFilter can do this, or the selection and extraction filters.

I’ll give more details on a new post explaining the exact situation

VMTK - the Vascular Modeling Toolkit (VTK-based toolkit for analyzing vascular trees) can process such networks. It can label branches, compute metrics that you can use to keep/remove branches. See vmtkbranch* scripts for examples how to use the filters.