Line width settings ignored when saving vis with OGL or TSG_OFFSCREEN

Geant4 Version: geant4-11-01-patch-03 (branch geant4-11.1-release)
Operating System: MacOS
Compiler/Version: Apple clang version 14.0.0
CMake Version: 3.27.4


I have a simple geometry for a project, but when I save png images with tsg_offscreen, calls I make to /vis/geometry/set/lineWidth get ignored.

To make sure I was using the lineWidth command correctly, I ran the same visualization with OGL, and I noticed that the lineWidth command also gets ignored when I save a pdf or eps file. BUT, the command works in an interactive session – it’s just the output of /vis/ogl/export (or /vis/viewer/rebuild for tsg_offscreen) that is unchanged by the lineWidth command.

Here is an example macro that I used to generate a png file with tsg_offscreen:

/run/initialize
/vis/open TSG_OFFSCREEN 600x600
/vis/drawVolume
/vis/viewer/set/viewpointVector 1 2 3
/vis/viewer/set/upVector 0 0 1
/vis/geometry/set/lineWidth all -1 5
/vis/tsg/offscreen/set/file auto tsg_geom
/vis/viewer/rebuild

which results in:

Then, a macro with OGL instead:

/run/initialize
/vis/open OGL 600x600
/vis/drawVolume
/vis/viewer/set/viewpointVector 1 2 3
/vis/viewer/set/upVector 0 0 1
/vis/geometry/set/lineWidth all -1 5
/vis/ogl/set/printFilename ogl_geom.pdf
/vis/ogl/export

generates (a screenshot of the original pdf, rescaled by a bit to fit my screen):

But, entering all but the last two lines into an interactive session gives (screenshot of the window):

where the lineWidth command has clearly done some heavy lifting that wasn’t present in the last two examples. Does anyone know why this is, and how I can get the command to work?

Hi AJ Biffl

It looks like line width is simply not implemented except for OpenGL. (I am currently trying to test VTK. I don’t have the means to try Open Inventor at the moment. As for ogl/export, it uses third party software, gl2ps, which would not be easy to fix.)

There is another command

/vis/viewer/set/globalLineWidthScale 5

but that seems to suffer the same limitation.

I will attempt to get this onto our to-do lists.

John

Great, thank you so much.

There are a few workarounds – screenshot the interactive view, as I did here, or generate pdf/eps and shrink the viewer so the lines remain the same thickness on the screen but appear larger compared to the image, then screenshot.

OK, thanks. Bear with us :slightly_smiling_face: