Any VTK examples?

Please fill out the following information to help in answering your question, and also see tips for posting code snippets. If you don’t provide this information it will take more time to help with your problem!

_Geant4 Version:_4.11.1.0
_Operating System:_Linux Fedora
_CMake Version:_3.27.7

I don’t see any examples of the use of vtk visualization in the examples directory of geant4-11.1.0. Could someone please point me to one? Thanks.

There’s no specific example. Just build with Vtk (see Installation Guide), then you should be able to use Vtk (/vis/open Vtk)with any example or app.

Thanks, John. I will give it a try. I was under the impression that vtk has some additional functionalties, like saving the view in a file. I assume I will find something like export view as… in the menu. We’ll see.
Thanks again.

Ah, yes, Munther. I’m afraid I forgot. There is examples/extended/visualization/vtk but

Author: Stewart Boogert <>
Date:   Sun Sep 17 17:02:45 2023 +0100

    vis vtk : added VTK example

which means only since 11.2.

Of course, once you build with Vtk, you get lots of nice commands. I recommend 11.2.

Ok, thanks. Downloaded v11.2.1 and now compiling. I do see the example examples/extended/visualization/vtk now. Getting a new geant version compiled with all the options I am used to is always a pain! Hopefully the vtk example will work. I will let you know.

I was to able to compile v11.2.1 and run the vtk example. Thanks!

1 Like