How to generate a Quadric mesh without topological holes

Hello, I am using vtkQuadric and vtkSampleFunction to generate a quadric surface mesh, however, my application has the requirement that all meshes be closed (by which I mean no holes). I was wondering if there was any way to close the topological holes. I had a look at vtkFillHolesFilter, but I noticed the warning:

Note that any mesh with boundary edges by definition has a topological hole. This even includes a reactangular grid (e.g., the output of vtkPlaneSource). In such situations, if the outer hole is filled, retriangulation of the hole will cause geometric overlap of the mesh. This can be prevented by using the hole size instance variable to prevent the larger holes from being triangulated.

My understanding of this warning is basically that you can’t use the vtkFillHolesFilter for such meshes. I gave it a go (just in case), and lo and behold, the holes do not appear to be closed. How I would like the holes to be closed: the box set with vtkSampleFunction.SetModelBounds determines the region of space over which the quadric surface is sampled, I would like to close the holes of the vtkQuadric along the box faces. I hope I have explained what I am trying to do clearly.

Is there any way I can do this in VTK? If not does anyone know of an algorithm which fits the bill? Perhaps I can implement it myself if so.

I have attached an image of a quadric with the hole that I don’t want, and one of the edges along which I would like to close the mesh highlighted.

Thanks for your help.


You can do it by turning the capping option in vtkSampleFunction. That is, CappingOn() function insures surfaces are closed.

1 Like

This is perfect, thank you so much!