vtkLoopSubdivisionFilter doesn't work properly

Hello! this is my first post due that I am having a problem:
I am using this example: https://kitware.github.io/vtk-examples/site/Cxx/Meshes/Subdivision/
replacing my OBJ file (a simple one based on triangles, vertex, vertex’s normal and faces).
However, the output is as follows:
Ys4Pw.jpg (1307×678) (imgur.com)

Any idea? Thanks!

Is the mesh watertight (manifold)? e.g., no duplicate points or edges, cracks, t-junctions, etc. Some of this can be cleaned up with vtkStaticCleanPolyData / vtkCleanPolyData.

Thanks for the answer Will.
I realized that using vtkOBJReader + vtkTriangleFilter, all the triangles are set as separate structures! Then, the image corresponds to a filter applied to each triangle (in a correct way). Thus, my problem is another!

Actually, I set everything to use a polydata P with the following:
GetNumberOfPieces: 1
GetNumberOfPolys: 286598
GetNumberOfPoints: 859794

And, using vtkLoopSubdivisionFilter over P is the image that I attached.
Any clue is welcome

Again, thanks a lot Will

Can you provide sample data? Assuming the data is triangles (as required by the filter), I am suspicious that the mesh is disconnected in some way.

Another suggestion: use ParaView for quick debugging situations like this. Filters like feature edges can be very helpful in spotting issues.

Sure!
Here is a sample OBJ WeTransfer - Send Large Files & Share Photos Online - Up to 2GB Free (it expires in 1 week).
Again, thanks.

The triangles are disconnected from each other. Use vtkCleanPolyData or vtkStaticCleanPolyData. This removes duplicate points with the effect of “joining” the mesh polygons.

Also the mesh has non-triangles in it. Finally, there are a few non-manifold edges. Both of which make the subdivision filters unhappy :frowning:

With a little work the mesh could be cleaned up…

I used the vtkStaticCleanPolyData + vtkTriangleFilter with PassLinesOff and PassVertsOff + playing with vtkSmoothPolyDataFilter + vtkPolyDataNormals and I obtained the image.
Isn’t fully subdivided as I expected… but at least is not the mess that I had before :skull_and_crossbones:

I know that removing the non-manifold points/edges is the way to input in vtk<…>SubdivisionFilter but well…is a job for the future me :grimacing:

Will, thanks for the support.

image