Python code for an attempt to create 3D stress lines. Uses VTK for visualisation and pycalfem and numpy for FEM computations. Pycalfem uses Gmesh for meshing. For full mesh manual see
http://www.byggmek.lth.se/fileadmin/byggnadsmekanik/publications/tvsm5000/web5187.pdf
The enthough Python package has the VTK package and numpy easily available. For explanation of the algorithm see below.