vtk.js shading with fringe interpolation

I would like to show an image in vtk.js with “fringe” shading, as shown below, but I can’t figure out how to do it. I can specify Gouraud or Phong interpolation on the actor property but it’s continuous, not discrete. I have seen some suggestions for doing this in Python or C++ VTK, by defining the number of levels on the ScalarBarActor, but those methods don’t appear to be available in vtk.js. Any advice would be greatly appreciated!

Wayne

image

If you play with the ScalarBarActor example, you can change the number of values and set “Interpolate Scalars” to true.

Thanks! That worked.