Vector Graphics Output issues

Hello,

I’m encountering issues with the vector graphics output (Export Scene > svg > … )

  1. the colorbar displacement appears to be a bug
  2. so do the two text layers on top of one another

Additional wishes for a more usable vector graphics output:

  1. Data Axis Grids commonly share a zero in a corner so it would be nice to have one be omitted
  2. having a tex-engine create the labels would be nice but this is not extremely important to me because I would just have a script process the svg file generating a pdf+tex pair which I can then pdflatex.
  3. If you think about 4, do consider a pdf+tex output. In this case you can do without the tex-engine
  4. I can live with rasterized 3D data, but things like the Data Axis Grid should be vectors.
  5. The coordinate system marker looks awful. I always end up building my own in inkscape, but this is tedious to do. It would be great to have a good-looking marker that is not rasterized in the vector output either. Have a look at the tecplot-marker. It may not be perfect either but I find it far better-looking and having a cube indicate where the 3D geometry is positioned in relation to the marker makes sense to me.

Getting publication-quality plots is such pain right now requiring a stack of at least Paraview+Inkscape or Paraview+Python/Matplotlib among many other workaround solutions.

Please don’t get me wrong, I still think that paraview is a great piece of software that I would not want to do without.
Are there any plans for improvements/fixes here though?

Thank you
Bastian

Version: 5.5.0 64bit

Hello

Which version of ParaView are you using ?

Version: 5.5.0 64bit (I added this information to the post)

@allison.vacanti

Vector graphics output, especially for 3D geometry, is in pretty sorry shape since the switch to OpenGL2. This is because of the exporter’s reliance on the GL2PS library, which uses deprecated functionality (specifically, OpenGL feedback buffers) that aren’t available in newer versions of OpenGL.

In particular, this means that all 3D geometry will be rasterized, unfortunately, as this is the only way to easily get the rendered primitives into the output at all. There is an option of using OpenGL TransformFeedback[1] to capture this geometry and inject it into GL2PS manually using the gl2psAddPolyPrimitive function[2], but this will require significant effort and funding to implement this into the OpenGL2 mappers.

One idea I’ve had is to move away from GL2PS and add a new renderer that manually translates a 3D scene into Context2D primitives so we could pipe these into one of the Context2D-specific vector exporters, vtkPDFExporter[3] and vtkSVGExporter[4]. These provide a higher quality output than GL2PS, as they can take advantage of format-specific features that get lost in the GL2PS abstraction. This would also take significant effort, but it would remove the reliance on external libraries.

As for the more specific questions about this export:

  1. Definitely a bug. Please open a gitlab issue for this.
  2. Also a bug, please make a separate issue. Not sure what would be causing that…
  3. That would need to be fixed in the AxisGrid classes. Feel free to file a request for this.
  4. GL2PS does export to tex, but I’m not sure how valuable this would be given the standing issues with that library. This would need to be a new exporter.
  5. Same as above.
  6. Unfortunately this is rendered through the 3D engine, and we aren’t able to fix this without updating the entire family of OpenGL2 mappers as described above. Vectorizing 3D geometry is an “all or nothing” endeavor, otherwise there will be issues with incorrect depth sorting.
  7. This sounds useful. Perhaps it could be included in a future vector graphics refactor or as a standalone enhancement for ParaView.

I agree that it’d be great to see this functionality improved in ParaView, but it’s going to be a significant undertaking and AFAIK our existing funding sources haven’t requested that we spend time on it.

[1] https://www.khronos.org/opengl/wiki/Transform_Feedback
[2] https://gitlab.onelab.info/gl2ps/gl2ps/blob/master/gl2ps.h#L237-242
[3] https://www.vtk.org/doc/nightly/html/classvtkPDFExporter.html
[4] https://www.vtk.org/doc/nightly/html/classvtkSVGExporter.html

1 Like