I have recently been playing with Geant4 11 and have enjoyed the addition of the VTK viewer.
My question is: is it possible to export OBJ files without having the graphical environment open? (similar to how one would use the VRML2FILE driver)
I am trying to use Geant4 in a headless container, with GDML input and OBJ output, and my approach so far has been to use a virtual framebuffer to host the display. However, both the VTKQt and VTKN drivers appear to block waiting for keyboard input once /run/beamOn has been called.
Thanks for using the new VTK viewer. It is possible to use VTK to export to OBJ no problem but not in a headless fashion you require. So to export to OBJ/VRML
/vis/vtk/export obj filename
or
/vis/vtk/export vrml filename
Just to clarify. VTKQt is not keyboard IO blocking per-se, but VTKN is. Well for your information q will exit the VTKN display and return input to the terminal.
As for the headless version, it will require a new driver, which does not create the actual render windows etc. Easy enough to implement, but will be in the next G4-VTK update. Well now I know there is a need, I will definitely add it, so something like VTKHeadless. This has lots of benefits in general as I too have a lot of problems running my container test builds and getting some diagnostic visualisation out.
Are you happy to edit the G4 source to implement a quick a dirty hack to get non blocking behaviour? Happy to send you a patch.
I have just tested this and a VTKN window is not opened and export to OBJ is possible.
If this is the only change, I will probably add a /vis/vtk/interactive flag opposed to deriving a whole new driver, still it will still have to wait for the next release. Please let me know how you get on with this fix in your container.