geviewer


Namegeviewer JSON
Version 0.2.1 PyPI version JSON
download
home_pagehttps://github.com/clarkehardy/geviewer.git
SummaryA lightweight, Python-based visualization tool for Geant4.
upload_time2024-08-31 20:47:18
maintainerNone
docs_urlNone
authorClarke Hardy
requires_python>=3.8
licenseMIT
keywords geant4 viewer visualizer display event simulation hep physics particle track detector geometry vrml heprep
VCS
bugtrack_url
requirements PyQt6 pyvistaqt lxml tqdm
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # GeViewer
![PyPI - Version](https://img.shields.io/pypi/v/geviewer?logo=pypi)
![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/clarkehardy/geviewer/.github%2Fworkflows%2Fpython-package.yml?logo=GitHub)
![Read the Docs](https://img.shields.io/readthedocs/geviewer?logo=readthedocs)
![GitHub last commit](https://img.shields.io/github/last-commit/clarkehardy/geviewer?logo=GitHub)
![GitHub License](https://img.shields.io/github/license/clarkehardy/geviewer)

GeViewer is a lightweight, Python-based visualization tool for Geant4. It provides a convenient way to
check detector geometries, view events, and produce publication-quality visuals,
without the hassle of setting up OpenGL or installing outdated software.

### Features

* **Physics-focused visuals:** See color-coded particle trajectories and hits in a 3D-rendered detector

* **Intuitive controls:** Use your mouse to rotate, zoom, pan, and interact with the geometry

* **Customizable viewing:** Choose the viewing perspective, rendering style, and background for optimal visibility

* **High-quality graphics:** Produce publication-quality visuals of detectors and events

* **Geometry inspection:** Check for overlaps, measure distances, and toggle visibility component-by-component

* **Fast performance:** Enjoy smooth, responsive rendering even with large and complex detector geometries

### User Interface

![The GeViewer UI in light mode with transparency enabled](https://github.com/clarkehardy/geviewer/blob/v0.2.1/docs/source/_static/sample1.png?raw=true)

![The GeViewer UI in dark mode with wireframe rendering enabled](https://github.com/clarkehardy/geviewer/blob/v0.2.1/docs/source/_static/sample2.png?raw=true)

## Setup
### Dependencies
The following packages are required, and will be installed automatically:

* `PyQt6`

* `pyvistaqt`

* `lxml`

* `tqdm`

### Installation
To ensure there are no conflicts with existing packages, it is recommended that you install GeViewer in a new Python environment.
```
python -m venv geviewer-env
source geviewer-env/bin/activate
```
GeViewer can then be installed using `pip` as follows:
```bash
pip install geviewer
```
To avoid having to manually activate the environment each time you want to launch GeViewer, you can add the following line to your `.bashrc` file:
```bash
alias geviewer='/path/to/geviewer-env/bin/python /path/to/geviewer-env/bin/geviewer'
```
To uninstall GeViewer, you can use `pip uninstall geviewer`, or you can simply delete the environment containing the installation:
```bash
rm -rf geviewer-env
```

## Usage
### Quick Start
Following installation, you can launch GeViewer from the command line:
```bash
geviewer
```
This will open a new window where you can then load files to view. Alternatively, you can provide a list of files to load from the command line:
```bash
geviewer /path/to/file1.heprep /path/to/file2.wrl
```
The next section describes how to produce files that can be read by GeViewer using Geant4.

### Instructions for Geant4
To produce Geant4 outputs that can be read by GeViewer, you must tell Geant4 to save the visualization either as a [HepRep file](https://www.slac.stanford.edu/~perl/heprep/index.html) or a [VRML file](https://en.wikipedia.org/wiki/VRML). HepRep files are preferred, as they allow you to turn on or off components or events individually. You can do this by putting the following in your macro file:
```
# this line should come BEFORE the /run/beamOn command
/vis/open HepRepFile
# you can also use /vis/open VRML2FILE
```
Following this, you can add the geometry, trajectories, and step markers. Any of these can be omitted if they are not needed, but note that without first adding trajectories, step markers will not be visible.
```
# now ensure that the geometry is displayed
/vis/drawVolume

# add the trajectories
/vis/scene/add/trajectories

# add the step markers
/vis/modeling/trajectories/create/drawByParticleID
/vis/modeling/trajectories/drawByParticleID-0/default/setDrawStepPts true

# ensure that they are not cleared at the end of the event
/vis/scene/endOfEventAction accumulate
```
There are many other visualization commands that can be added here as well. Consult the [Geant4 documentation](https://geant4.web.cern.ch/docs/) for more information. This section is also where you can put any other application-specific commands. Next, start the simulation with `/run/beamOn` followed by the number of primaries to generate. For visualization purposes, you should not be generating more than a handful of events.
```
# specify the number of events and start the simulation
/run/beamOn 1
```
Finally, refresh the viewer to ensure that the events generated have been added.
```
/vis/viewer/flush
```
By default, the file will be saved in the working directory (as `G4Data0.heprep` for HepRep files and `g4_00.wrl` for VRML files), but it can easily be renamed from within the macro by issuing a shell command.
```
/control/shell mv G4Data0.heprep /new/path/to/file.heprep
```
If you are using your local computer, you can even pipe the output file directly to GeViewer to have the application load the file automatically following the simulation.
```
/control/shell geviewer /new/path/to/file.heprep
```
Note that this will not work if you are running Geant4 on a remote machine over `ssh`, as GeViewer cannot be run using X11 forwarding. If that is your use case, you can download the resulting visualization file to open on your local computer.

### Viewing Files

#### Loading files
To load a file, click **File > Open File...** in the menu bar. This will open a dialog where you can select the file to load. Repeat this process to load multiple files simultaneously. To clear the currently loaded files, click **Edit > Clear Viewer**.

When a file is loaded, a list of checkboxes will appear in the components panel on the left, allowing individual components to be toggled on or off. For HepRep files, this list will include all individual detector components and events in a hierarchy as defined in Geant4. Components with identical names, or components with the same names up to a numerical suffix, will be grouped together. This is necessary to show larger geometries containing too many components to render individually while maintaining performance (e.g. a detector with 100,000 identical SiPMs). For VRML files, the list will contain three components: the geometry, the trajectories, and the step markers. Each of these can only be toggled on or off as a whole.

Clicking a checkbox will toggle the visibility of the corresponding component and all of its children. By working from the top of the hierarchy downwards, and combination of visibilities can be achieved.

#### Interacting with the viewer

Most of the interactive controls should be intuitive, but a brief summary is provided below:

* To rotate the view, click and drag
* To zoom in and out, scroll or right click and drag
* To pan, shift + click or click the scroll wheel and drag
* To roll, ctrl + click and drag on Windows or command + click and drag on Mac and Linux

#### Toolbar view options

The toolbar provides a number of additional options for customizing the view. These include:
 * Toggling between wireframe and solid rendering modes

 * Toggling between opaque and transparent rendering modes. As HepRep files do not contain transparency information, this will affect all components simultaneously. For VRML files, which do contain transparency information, this will scale the transparency of all components uniformly.

 * Toggling between perspective and parallel projection modes. Perspective projection appears most natural and is therefore the default. For a true compoarison of object sizes independent of distance, however, parallel projection may be more useful.

 * Switching to common views, including:
    * Isometric view
    * Top view
    * Bottom view
    * Left view
    * Right view
    * Front view
    * Back view

#### Customizing the background
The default background is a gradient from light sky blue to navy blue. Under the View menu, both of these colors can be changed, the gradient can be turned on or off, and the background can be reset to the default.

### View Options

#### Camera view parameters
While the camera view can be set completely using the mouse, more precise control can be achieved using the text fields in the Options tab of the control panel. Each of the following are set with vectors of three floating-point numbers, representing $x$, $y$, and $z$:

* **Camera position:** The position of the camera in world coordinates.

* **Camera focal point:** The point in world coordinates that the camera is looking at.

* **Camera up vector:** The direction in world coordinates that is considered "up" for the camera.

These text fields will be continually updated as the view is manipulated, allowing the user to use the view parameters displayed as a reference when setting them manually.

#### Event viewer
When a file is loaded, all events are shown simultaneously. To view an individual event, the spin box on the Options tab of the control panel can be used. This will turn off all other trajectories and trajectory step points, leaving only the selected event visible. Clicking the arrow buttons on the spin box, or using the arrow keys on your keyboard with the spin box selected, will cycle through the events.

#### Exporting figures
At any time, the current view can be exported by clicking the Export Figure button on the Options tab of the control panel. Any of the following file formats are supported: `.png`, `.jpeg`, `.jpg`, `.bmp`, `.tif`, `.tiff`, `.svg`, `.eps`, `.ps`, `.pdf`, `.tex`. When exporting a figure, the figure size in pixels can be set by providing the width and height in the Figure size text field. The default figure size is 1920x1440 pixels, which corresponds to a 6.4 inch by 4.8 inch figure at 300 dpi.

### Geometry Tools
#### Overlap inspector
The Tools tab on the control panel contains the overlap inspector and a measurement tool. The overlap inspector can be used to check for overlaps between detector components, will a few essential caveats:

* If a component is contained entirely within another, the overlap will not be reported.

* If a component's mesh is not closed, it cannot be checked for overlaps. Meshes written to HepRep files by Geant4 occasionally have open edges. Small defects will be repaired when a file is loaded into GeViewer, but larger openings cannot be fixed. These components will be skipped during overlap checking.

* The overlap inspector checks for overlaps in the **meshes as produced by Geant4**, which may not reflect the **true geometry defined by the user**. When a mesh is exported from Geant4, smooth surfaces are approximated with many discrete faces. This may introduce spurious overlaps, as demonstrated in the figure below.

![Spurious overlaps resulting from mesh approximation](https://github.com/clarkehardy/geviewer/blob/v0.2.1/docs/source/_static/overlaps.png?raw=true)

The overlap inspector works by iterating through all possible pairs of components and checking each pair for overlaps. The overlap checking is done first by determining if the bounding boxes overlap. If they do, a set of sample points is generated within one of the bounding boxes. The number of points is set by the text field in the Tools tab of the control panel. The subset of these points that falls inside the mesh are then kept, while the others are thrown out. The surviving points, which approximate the solid body of one of the meshes, are then checked to determine if any fall inside the other mesh. If they do, the overlap will be reported and the points in the overlapping region will be shown in red, with all but the overlapping components hidden to highlight the location of the overlap.

If the file includes many identical components which have been grouped together during loading, these will have to be individually checked for overlaps with all other components. This has the potential to be a very time-consuming operation for large arrays of identical components (e.g. thousands of SiPMs), so use good judgement when selecting which components to include in overlap checking.

#### Measurement tool
The Measurement Tool, on the Tools tab of the control panel, can be used to measure the distance between any two points. To use the tool, click Add measurement, then click two points in the viewer to measure the distance between them. The measurement will be shown on the viewer and will also be reported in the text field in the Tools tab. Up to three distance measurements will be shown in the Tools tab at a time. As new measurements are added, the oldest will be removed to keep the total number of measurements displayed at three.

### Additional Options
#### Saving files
HepRep files that are particularly large (>1 GB) can take a minute or more to parse and load. Fortunately, this step needs to be done only once. After a file is loaded, it can be saved in a more convenient format for much faster loading in the future. With a file open, click **File > Save As...** in the menu bar. This will open a dialog allowing for a destination file path to be provided. The file must be saved with the `.gev` extension in order for GeViewer to recognize it. GeViewer sessions with multiple open files can similarly be saved and loaded.

#### File converter utility
The file parsing and loading steps can be called from the command line, or from within a Geant4 macro, to avoid the need to manually start the process when GeViewer is launched. This is done using the `gev-converter` command line utility, which is installed automatically along with GeViewer. To use the utility, call it with the path to a file to be converted and the path to a destination file with the `.gev` extension.
```bash
gev-converter /path/to/file.heprep /path/to/file.gev
```
This command can be issued from within a Geant4 macro:
```
/control/shell gev-converter G4Data0.heprep /path/to/file.gev
```
The `gev-converter` utility does not have an interactive component and can therefore be run on a remote machine over `ssh`.

#### Other options
* [Depth peeling](https://en.wikipedia.org/wiki/Depth_peeling) is a technique for rendering transparent objects. It is disabled by default as it often slows down rendering. To enable depth peeling, click the **View > Use Depth Peeling** menu item.

* Most operations in GeViewer will be reported in the console on the control panel, as will any errors or warnings. The console can be cleared by clicking **Edit > Clear Console**, and the contents of the console can be copied to the clipboard by clicking **Edit > Copy Console**.

* Operations can be aborted by clicking **Edit > Abort Process**. This can be useful if, for example, you start checking for overlaps without unselecting a component with many subcomponents. Needless to say, this should be done sparingly.

## Additional Info
### Contributing
GeViewer has been developed and tested using a limited number of Geant4 detector geometries, so the HepRep and VRML parsing functionalities are not yet exhaustive. If you find that a particular geometry or component is not being parsed correctly, please [open an issue](https://github.com/clarkehardy/geviewer/issues) on the GitHub repository and provide the file snippet in question, or fix the issue yourself and submit a pull request. Other suggestions, feature requests, or improvements are also welcome.

### License
Distributed under the MIT License. See [LICENSE](https://github.com/clarkehardy/geviewer/blob/main/LICENSE) for more information.

### Contact
Clarke Hardy – [cahardy@stanford.edu](mailto:cahardy@stanford.edu)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/clarkehardy/geviewer.git",
    "name": "geviewer",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "geant4, viewer, visualizer, display, event, simulation, hep, physics, particle, track, detector, geometry, vrml, heprep",
    "author": "Clarke Hardy",
    "author_email": "Clarke Hardy <cahardy@stanford.edu>",
    "download_url": "https://files.pythonhosted.org/packages/f5/ae/36db977222efc57ec93c79c9dfca7f5382128f27a8993bbbc08a418d60c2/geviewer-0.2.1.tar.gz",
    "platform": null,
    "description": "# GeViewer\n![PyPI - Version](https://img.shields.io/pypi/v/geviewer?logo=pypi)\n![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/clarkehardy/geviewer/.github%2Fworkflows%2Fpython-package.yml?logo=GitHub)\n![Read the Docs](https://img.shields.io/readthedocs/geviewer?logo=readthedocs)\n![GitHub last commit](https://img.shields.io/github/last-commit/clarkehardy/geviewer?logo=GitHub)\n![GitHub License](https://img.shields.io/github/license/clarkehardy/geviewer)\n\nGeViewer is a lightweight, Python-based visualization tool for Geant4. It provides a convenient way to\ncheck detector geometries, view events, and produce publication-quality visuals,\nwithout the hassle of setting up OpenGL or installing outdated software.\n\n### Features\n\n* **Physics-focused visuals:** See color-coded particle trajectories and hits in a 3D-rendered detector\n\n* **Intuitive controls:** Use your mouse to rotate, zoom, pan, and interact with the geometry\n\n* **Customizable viewing:** Choose the viewing perspective, rendering style, and background for optimal visibility\n\n* **High-quality graphics:** Produce publication-quality visuals of detectors and events\n\n* **Geometry inspection:** Check for overlaps, measure distances, and toggle visibility component-by-component\n\n* **Fast performance:** Enjoy smooth, responsive rendering even with large and complex detector geometries\n\n### User Interface\n\n![The GeViewer UI in light mode with transparency enabled](https://github.com/clarkehardy/geviewer/blob/v0.2.1/docs/source/_static/sample1.png?raw=true)\n\n![The GeViewer UI in dark mode with wireframe rendering enabled](https://github.com/clarkehardy/geviewer/blob/v0.2.1/docs/source/_static/sample2.png?raw=true)\n\n## Setup\n### Dependencies\nThe following packages are required, and will be installed automatically:\n\n* `PyQt6`\n\n* `pyvistaqt`\n\n* `lxml`\n\n* `tqdm`\n\n### Installation\nTo ensure there are no conflicts with existing packages, it is recommended that you install GeViewer in a new Python environment.\n```\npython -m venv geviewer-env\nsource geviewer-env/bin/activate\n```\nGeViewer can then be installed using `pip` as follows:\n```bash\npip install geviewer\n```\nTo avoid having to manually activate the environment each time you want to launch GeViewer, you can add the following line to your `.bashrc` file:\n```bash\nalias geviewer='/path/to/geviewer-env/bin/python /path/to/geviewer-env/bin/geviewer'\n```\nTo uninstall GeViewer, you can use `pip uninstall geviewer`, or you can simply delete the environment containing the installation:\n```bash\nrm -rf geviewer-env\n```\n\n## Usage\n### Quick Start\nFollowing installation, you can launch GeViewer from the command line:\n```bash\ngeviewer\n```\nThis will open a new window where you can then load files to view. Alternatively, you can provide a list of files to load from the command line:\n```bash\ngeviewer /path/to/file1.heprep /path/to/file2.wrl\n```\nThe next section describes how to produce files that can be read by GeViewer using Geant4.\n\n### Instructions for Geant4\nTo produce Geant4 outputs that can be read by GeViewer, you must tell Geant4 to save the visualization either as a [HepRep file](https://www.slac.stanford.edu/~perl/heprep/index.html) or a [VRML file](https://en.wikipedia.org/wiki/VRML). HepRep files are preferred, as they allow you to turn on or off components or events individually. You can do this by putting the following in your macro file:\n```\n# this line should come BEFORE the /run/beamOn command\n/vis/open HepRepFile\n# you can also use /vis/open VRML2FILE\n```\nFollowing this, you can add the geometry, trajectories, and step markers. Any of these can be omitted if they are not needed, but note that without first adding trajectories, step markers will not be visible.\n```\n# now ensure that the geometry is displayed\n/vis/drawVolume\n\n# add the trajectories\n/vis/scene/add/trajectories\n\n# add the step markers\n/vis/modeling/trajectories/create/drawByParticleID\n/vis/modeling/trajectories/drawByParticleID-0/default/setDrawStepPts true\n\n# ensure that they are not cleared at the end of the event\n/vis/scene/endOfEventAction accumulate\n```\nThere are many other visualization commands that can be added here as well. Consult the [Geant4 documentation](https://geant4.web.cern.ch/docs/) for more information. This section is also where you can put any other application-specific commands. Next, start the simulation with `/run/beamOn` followed by the number of primaries to generate. For visualization purposes, you should not be generating more than a handful of events.\n```\n# specify the number of events and start the simulation\n/run/beamOn 1\n```\nFinally, refresh the viewer to ensure that the events generated have been added.\n```\n/vis/viewer/flush\n```\nBy default, the file will be saved in the working directory (as `G4Data0.heprep` for HepRep files and `g4_00.wrl` for VRML files), but it can easily be renamed from within the macro by issuing a shell command.\n```\n/control/shell mv G4Data0.heprep /new/path/to/file.heprep\n```\nIf you are using your local computer, you can even pipe the output file directly to GeViewer to have the application load the file automatically following the simulation.\n```\n/control/shell geviewer /new/path/to/file.heprep\n```\nNote that this will not work if you are running Geant4 on a remote machine over `ssh`, as GeViewer cannot be run using X11 forwarding. If that is your use case, you can download the resulting visualization file to open on your local computer.\n\n### Viewing Files\n\n#### Loading files\nTo load a file, click **File > Open File...** in the menu bar. This will open a dialog where you can select the file to load. Repeat this process to load multiple files simultaneously. To clear the currently loaded files, click **Edit > Clear Viewer**.\n\nWhen a file is loaded, a list of checkboxes will appear in the components panel on the left, allowing individual components to be toggled on or off. For HepRep files, this list will include all individual detector components and events in a hierarchy as defined in Geant4. Components with identical names, or components with the same names up to a numerical suffix, will be grouped together. This is necessary to show larger geometries containing too many components to render individually while maintaining performance (e.g. a detector with 100,000 identical SiPMs). For VRML files, the list will contain three components: the geometry, the trajectories, and the step markers. Each of these can only be toggled on or off as a whole.\n\nClicking a checkbox will toggle the visibility of the corresponding component and all of its children. By working from the top of the hierarchy downwards, and combination of visibilities can be achieved.\n\n#### Interacting with the viewer\n\nMost of the interactive controls should be intuitive, but a brief summary is provided below:\n\n* To rotate the view, click and drag\n* To zoom in and out, scroll or right click and drag\n* To pan, shift + click or click the scroll wheel and drag\n* To roll, ctrl + click and drag on Windows or command + click and drag on Mac and Linux\n\n#### Toolbar view options\n\nThe toolbar provides a number of additional options for customizing the view. These include:\n * Toggling between wireframe and solid rendering modes\n\n * Toggling between opaque and transparent rendering modes. As HepRep files do not contain transparency information, this will affect all components simultaneously. For VRML files, which do contain transparency information, this will scale the transparency of all components uniformly.\n\n * Toggling between perspective and parallel projection modes. Perspective projection appears most natural and is therefore the default. For a true compoarison of object sizes independent of distance, however, parallel projection may be more useful.\n\n * Switching to common views, including:\n    * Isometric view\n    * Top view\n    * Bottom view\n    * Left view\n    * Right view\n    * Front view\n    * Back view\n\n#### Customizing the background\nThe default background is a gradient from light sky blue to navy blue. Under the View menu, both of these colors can be changed, the gradient can be turned on or off, and the background can be reset to the default.\n\n### View Options\n\n#### Camera view parameters\nWhile the camera view can be set completely using the mouse, more precise control can be achieved using the text fields in the Options tab of the control panel. Each of the following are set with vectors of three floating-point numbers, representing $x$, $y$, and $z$:\n\n* **Camera position:** The position of the camera in world coordinates.\n\n* **Camera focal point:** The point in world coordinates that the camera is looking at.\n\n* **Camera up vector:** The direction in world coordinates that is considered \"up\" for the camera.\n\nThese text fields will be continually updated as the view is manipulated, allowing the user to use the view parameters displayed as a reference when setting them manually.\n\n#### Event viewer\nWhen a file is loaded, all events are shown simultaneously. To view an individual event, the spin box on the Options tab of the control panel can be used. This will turn off all other trajectories and trajectory step points, leaving only the selected event visible. Clicking the arrow buttons on the spin box, or using the arrow keys on your keyboard with the spin box selected, will cycle through the events.\n\n#### Exporting figures\nAt any time, the current view can be exported by clicking the Export Figure button on the Options tab of the control panel. Any of the following file formats are supported: `.png`, `.jpeg`, `.jpg`, `.bmp`, `.tif`, `.tiff`, `.svg`, `.eps`, `.ps`, `.pdf`, `.tex`. When exporting a figure, the figure size in pixels can be set by providing the width and height in the Figure size text field. The default figure size is 1920x1440 pixels, which corresponds to a 6.4 inch by 4.8 inch figure at 300 dpi.\n\n### Geometry Tools\n#### Overlap inspector\nThe Tools tab on the control panel contains the overlap inspector and a measurement tool. The overlap inspector can be used to check for overlaps between detector components, will a few essential caveats:\n\n* If a component is contained entirely within another, the overlap will not be reported.\n\n* If a component's mesh is not closed, it cannot be checked for overlaps. Meshes written to HepRep files by Geant4 occasionally have open edges. Small defects will be repaired when a file is loaded into GeViewer, but larger openings cannot be fixed. These components will be skipped during overlap checking.\n\n* The overlap inspector checks for overlaps in the **meshes as produced by Geant4**, which may not reflect the **true geometry defined by the user**. When a mesh is exported from Geant4, smooth surfaces are approximated with many discrete faces. This may introduce spurious overlaps, as demonstrated in the figure below.\n\n![Spurious overlaps resulting from mesh approximation](https://github.com/clarkehardy/geviewer/blob/v0.2.1/docs/source/_static/overlaps.png?raw=true)\n\nThe overlap inspector works by iterating through all possible pairs of components and checking each pair for overlaps. The overlap checking is done first by determining if the bounding boxes overlap. If they do, a set of sample points is generated within one of the bounding boxes. The number of points is set by the text field in the Tools tab of the control panel. The subset of these points that falls inside the mesh are then kept, while the others are thrown out. The surviving points, which approximate the solid body of one of the meshes, are then checked to determine if any fall inside the other mesh. If they do, the overlap will be reported and the points in the overlapping region will be shown in red, with all but the overlapping components hidden to highlight the location of the overlap.\n\nIf the file includes many identical components which have been grouped together during loading, these will have to be individually checked for overlaps with all other components. This has the potential to be a very time-consuming operation for large arrays of identical components (e.g. thousands of SiPMs), so use good judgement when selecting which components to include in overlap checking.\n\n#### Measurement tool\nThe Measurement Tool, on the Tools tab of the control panel, can be used to measure the distance between any two points. To use the tool, click Add measurement, then click two points in the viewer to measure the distance between them. The measurement will be shown on the viewer and will also be reported in the text field in the Tools tab. Up to three distance measurements will be shown in the Tools tab at a time. As new measurements are added, the oldest will be removed to keep the total number of measurements displayed at three.\n\n### Additional Options\n#### Saving files\nHepRep files that are particularly large (>1 GB) can take a minute or more to parse and load. Fortunately, this step needs to be done only once. After a file is loaded, it can be saved in a more convenient format for much faster loading in the future. With a file open, click **File > Save As...** in the menu bar. This will open a dialog allowing for a destination file path to be provided. The file must be saved with the `.gev` extension in order for GeViewer to recognize it. GeViewer sessions with multiple open files can similarly be saved and loaded.\n\n#### File converter utility\nThe file parsing and loading steps can be called from the command line, or from within a Geant4 macro, to avoid the need to manually start the process when GeViewer is launched. This is done using the `gev-converter` command line utility, which is installed automatically along with GeViewer. To use the utility, call it with the path to a file to be converted and the path to a destination file with the `.gev` extension.\n```bash\ngev-converter /path/to/file.heprep /path/to/file.gev\n```\nThis command can be issued from within a Geant4 macro:\n```\n/control/shell gev-converter G4Data0.heprep /path/to/file.gev\n```\nThe `gev-converter` utility does not have an interactive component and can therefore be run on a remote machine over `ssh`.\n\n#### Other options\n* [Depth peeling](https://en.wikipedia.org/wiki/Depth_peeling) is a technique for rendering transparent objects. It is disabled by default as it often slows down rendering. To enable depth peeling, click the **View > Use Depth Peeling** menu item.\n\n* Most operations in GeViewer will be reported in the console on the control panel, as will any errors or warnings. The console can be cleared by clicking **Edit > Clear Console**, and the contents of the console can be copied to the clipboard by clicking **Edit > Copy Console**.\n\n* Operations can be aborted by clicking **Edit > Abort Process**. This can be useful if, for example, you start checking for overlaps without unselecting a component with many subcomponents. Needless to say, this should be done sparingly.\n\n## Additional Info\n### Contributing\nGeViewer has been developed and tested using a limited number of Geant4 detector geometries, so the HepRep and VRML parsing functionalities are not yet exhaustive. If you find that a particular geometry or component is not being parsed correctly, please [open an issue](https://github.com/clarkehardy/geviewer/issues) on the GitHub repository and provide the file snippet in question, or fix the issue yourself and submit a pull request. Other suggestions, feature requests, or improvements are also welcome.\n\n### License\nDistributed under the MIT License. See [LICENSE](https://github.com/clarkehardy/geviewer/blob/main/LICENSE) for more information.\n\n### Contact\nClarke Hardy \u2013 [cahardy@stanford.edu](mailto:cahardy@stanford.edu)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A lightweight, Python-based visualization tool for Geant4.",
    "version": "0.2.1",
    "project_urls": {
        "Homepage": "https://github.com/clarkehardy/geviewer.git",
        "documentation": "https://geviewer.readthedocs.io/",
        "repository": "https://github.com/clarkehardy/geviewer.git"
    },
    "split_keywords": [
        "geant4",
        " viewer",
        " visualizer",
        " display",
        " event",
        " simulation",
        " hep",
        " physics",
        " particle",
        " track",
        " detector",
        " geometry",
        " vrml",
        " heprep"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7a16745823e42051d217a3e20fbefdd2a0070b98c10d5ccdbc10c173a621713c",
                "md5": "b07d936ca2d0d420a5da33e5fa242369",
                "sha256": "47e763bb8694c67320aa8894c197a144120d3884328c6490afd0beac8de6e390"
            },
            "downloads": -1,
            "filename": "geviewer-0.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b07d936ca2d0d420a5da33e5fa242369",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 40364,
            "upload_time": "2024-08-31T20:47:16",
            "upload_time_iso_8601": "2024-08-31T20:47:16.698534Z",
            "url": "https://files.pythonhosted.org/packages/7a/16/745823e42051d217a3e20fbefdd2a0070b98c10d5ccdbc10c173a621713c/geviewer-0.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f5ae36db977222efc57ec93c79c9dfca7f5382128f27a8993bbbc08a418d60c2",
                "md5": "68b8285b2e5ba3d22869402d221b6551",
                "sha256": "61acac5efe6f9fd0fa933b7dec9fa1b74b4c3c2abdd6af0fb94a632d05461c5e"
            },
            "downloads": -1,
            "filename": "geviewer-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "68b8285b2e5ba3d22869402d221b6551",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 45385,
            "upload_time": "2024-08-31T20:47:18",
            "upload_time_iso_8601": "2024-08-31T20:47:18.214699Z",
            "url": "https://files.pythonhosted.org/packages/f5/ae/36db977222efc57ec93c79c9dfca7f5382128f27a8993bbbc08a418d60c2/geviewer-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-31 20:47:18",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "clarkehardy",
    "github_project": "geviewer",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "PyQt6",
            "specs": []
        },
        {
            "name": "pyvistaqt",
            "specs": []
        },
        {
            "name": "lxml",
            "specs": []
        },
        {
            "name": "tqdm",
            "specs": []
        }
    ],
    "lcname": "geviewer"
}
        
Elapsed time: 3.87882s