Surface Streamlines in VTK/ParaView

November 20, 2015

Streamlines are a great way to​​ represent a vector field in VTK and​ are ​widely used by ParaView users. However​ until our recent change, streamlines missed one feature that prevent​ed​ them to be used in any situation: an option to constrained them to stay on the surface.

This is now done and available since P​ara​V​iew 4.4: vtkStreamTracer has a SurfaceStreamlines boolean option which is exposed as an advanced option of the ParaView filter.​ This feature makes possible to generate streamlines on any surface, with vector in any direction.

See the following example: on this warped surface, there ​are some vectors on each point, with a direction going out of the surface, and yet, with this surface option, it is still possible to trace streamlines as you can see below.

On the technical side, some improvements have been necessary in order to achieve that. First it was necessary to correct the implementation of some 2D cells, as some did not compute parametric coordinates, when executing ​the EvaluatePosition() method. Then we added the code to "snap" the streamlines on the surface. We also had to compute and use ​the ​surface tangential vector instead of using the user provided vectors. Finally we had to ​use the FindPoint() method in order to always find the closest cells of a streamlines point.

Hope you will enjoy!

 

Leave a Reply