Extract closed Surface or Generate 3D mesh or volume from two non-closed surface

Hi Fellas,

I am currently developing a tool to create a 3D mesh or volume from two non-closed surface using vtk.

For illustration: Imagine a Digital Elevation Model (surface model) that lies on top of another DEM with a vertical distance between them (the first has an average altitude of 200 m, and the second is 100 m above sea level).

The problem is, I was successfully visualize both surfaces using vtkDelaunay2D (input file XYZ points), but I had a problem when i am going to fill (or close) the space between them, since I need to get a closed surface (or volume).

I have tried using vtkExtractSurface, vtkDelaunay3D, and vtkUnstructuredGridVolumeRayCastMapper, unfortunately non of them give a decent result.

Do you guys have a suggestion which vtk filter fits best for my case? Any suggestion will be very helpful.

This is definitely non-trivial. In order to make a 3D volumetric mesh, you’ll first need to create a closed, manifold surface from the two surfaces you have. To create the closed surface, there are tons of techniques, but perhaps you could try using the vtkLinearExtrusionFilter to extrude one surface, clip that mesh by the other surface, clean the resulting mesh, and try a meshing algorithm like vtkDelaunay3D or PyVista’s wrapper of TetGen on the closed surface.

Or you could use both surfaces to clip something like an imagedata mesh that shares the same extent and use that result as the full 3D mesh?

Lots of creative ways to go about this but its definitely difficult to find a methodology that you can rely on working regardless of inputs - in my experience, your routine will have to make assumptions about the input meshes.

Hi Bane,

Thanks a lot for your advice. That is really helpful.

Now I can build a 3D mesh by extruding the upper surface using vtkLinearExtrusionFilter. I also have managed to clip the mesh with a plane simply by using vtkClipClosedSurface (though that is not what I need).

However, it always failed when turns to the clipping the 3D mesh using the surface underneath, I have also tried to use vtkClipPolyData but neither giving an expected result.

Do you think those methods could do the task with surface / delaunay2D as an input? Or do I need another method/filter type?

Hi @rezaramdhan, I’ve run into the same problem, did you managed to create this tool in the end?


For Boolean operation between meshes, vtkbool library works quite well.

Woah ! Thanks, looks very promising. I was just searching from the official documentation.