Does VTK have an implementation of the SurfaceNets algorithm for a continuous scalar field?

There are a lot of layers to answer these questions.

SurfaceNets is a multipart algorithm. As originally described, it begins by extracting voxel faces shared by neighboring voxels in different labeled regions. Then, a smoothing algorithm is used to improve what is typically a very aliased surface. This smoothing is what takes an ugly mesh and makes it better.

In Flying Edges and their ilk, surfaces are simply extracted, possibly with vertex normals, so they can render quite well. However, there is often a mix of cells of various quality, including slivers etc. However, this can be improved by using follow-on filters such as vtkWindowedSincPolyDataFilter, or vtkConstrainedSmoothingFilter. (There may be other filters to improve mesh quality, maybe the community can weigh in on this).

If you want to use vtkSurfaceNets3D, you can always write some simple code to take the continuous input scalar field and segment (label) it. Basically a lookup table from scalar value to id.

See this reference for vtkSurfaceNets3D. If you use it, I recommend that you make sure you build with SMP enabled, using the stdthread or TBB backend.

1 Like