vtkImplicitSelectionLoop and sharp corners - potential bug?

Hi Developers,

I am trying to get around the issue, which was observed already 3 years ago (vtkImplicitSelectionLoop does not work as expected). To shortly summarize, the issue is that vtkImplicitSelectionLoop works poorly for clipping when the loop has sharp corners. I have tested that the issue is still present in VTK 9.2.6 with following code and outcome:
python_minEx_clipSelectionLoop.py (8.9 KB)

Is this a bug or is there some technical/theoretical issues in getting this to work? I searched the VTK issue tracker (Issues · VTK / VTK · GitLab (kitware.com)) but did not find anything related to this. If this is a bug, should I report an issue there?

Best wishes,
Ugis

I remember trying some crazy workarounds to get it done. In summary, I had to embed the loop polygons onto the surface before clipping.

@will.schroeder

Implicit functions followed by contouring on low resolution grids generally do not provide high accuracy results. For example, if you look at the case tables for marching cubes there is no way to get sharp corners inside a cell.

It’s better to use something like vtkCookieCutter or vtkImprintFilter to obtain higher precision results.

Thanks a lot for explanation about implicit functions; then it seems to be rather an algorithmic limitation and not really a bug, so that is clear to me now.

And thanks a lot about the suggestion of vtkCookieCutter (I have not yet tried vtkImprintFilter). This has gotten me almost to the result I am looking for. With this code:
python_minEx_cookieCutter.py (10.1 KB)
I managed to get these results:

So the shape that vtkCookieCutter takes out is spot-on (just needed to triangulate it for solid representation), however I can not get rid of artifacts in the corner … From documentation I understood that I need scalar values also on the loop I am cutting with, so I have tried to obtain those with vtkPointInterpolator. But trying both vtkLinearKernel and vtkGaussianKernel does not seem to produce exact results. @will.schroeder, perhaps you have some idea regarding what I am missing?