How to show gradient of isoSurface based on color.

I’m trying to understand how I can render an isosurface and show it’s gradient using color. There are a few examples but it is unclear how to do this with an isosurface.

Do you want to display, say, red for sharper locations and blue for smoother areas?

If so, you need to compute something called curvature. You’ll need a library specialized in mesh processing for that:

This, or delving into the theory behind it and implementing it yourself:


Does VTK not do this?

I don’t think so. VTK was originally made for visualizing results for computations made by some other code, though some algorithms (such as FFT) have been added throughout the years. It is normal for a scientific software pack to depend on many different libraries. Mine, for instance, depends on ITK, Eigen, Boost, GSLib, fftw3 and GSL to perform computations that VTK doesn’t have or is not as good as at.

Maybe you can try vtkCurvatures: https://vtk.org/doc/nightly/html/classvtkCurvatures.html .

Though I’ve never used that class myself.

Example here: https://lorensen.github.io/VTKExamples/site/Cxx/PolyData/Curvatures (if it’s down, try again later).