Skip to main content

Geometry package for high energy physics (Geant4, Fluka)

Project description

pyg4ometry

Python code for rapid creation and conversion of radiation transport Monte Carlo (Geant4 and Fluka) geometries.

PyPI GitHub tag (latest by date) GitHub Workflow Status pre-commit Code style: black Codecov GitHub issues GitHub pull requests License DOI Read the Docs

Quick start

pyg4ometry is a very capable package to do many tasks related to Geant4/Fluka/MCNP geometry:

  • Python scripting to create and assemble geometries
  • Loading, editing and writing GDML
  • Load and tessellate CAD geometry and export to GDML
  • Load ROOT geometry and convert to GDML
  • Powerful VTK viewer of geometries
  • Converting from GDML to FLUKA and MCNP
  • Exporting mesh geometries from GDML to VTP, OBJ, VRML etc.
  • Python bindings to CGAL allowing complex mesh manipulation (e.g. hole filling, remeshing)

All with few lines of Python code!

import pyg4ometry as pg4
from g4edgetestdata import G4EdgeTestData

g4data = G4EdgeTestData()
# define a geometry registry
reg = pg4.geant4.Registry()

# build the world volume
world_s = pg4.geant4.solid.Orb("WorldAir", 1.5, reg, lunit="cm")
world_l = pg4.geant4.LogicalVolume(world_s, "G4_AIR", "WorldAir", reg)
reg.setWorld(world_l)

# import an STL file
reader = pg4.stl.Reader(g4data["stl/utah_teapot.stl"], registry=reg)
teapot_s = reader.getSolid()

# place the teapot in the world
teapot_l = pg4.geant4.LogicalVolume(teapot_s, "G4_Cu", "UtahTeapot", reg)
pg4.geant4.PhysicalVolume([0, 0, 0], [0, 0, 0], teapot_l, "UtahTeapot", world_l, reg)

# export to GDML file "geometry.gdml"
writer = pg4.gdml.Writer()
writer.addDetector(reg)
writer.write("./geometry.gdml")

# start an interactive VTK viewer instance
viewer = pg4.visualisation.VtkViewer()
viewer.addLogicalVolume(reg.getWorldVolume())
viewer.view()

Check out our video tutorial for more:

IMAGE ALT TEXT HERE

How to Install

Pre-built pyg4ometry wheels can be installed from PyPI using pip:

pip install pyg4ometry

If you cannot find wheels for your operating system / architecture, please open an issue. Building from source requires some non-Python software dependencies. More documentation can be found in the installation guide in the manual.

Many people and groups are using pyg4ometry

Referencing and Citation

To support the development and maintenance of pyg4ometry, please cite it! Any publications including simulations made using this software must cite the pyg4ometry paper:

S.D. Walker, A. Abramov, L.J. Nevay, W. Shields, S.T. Boogert, “pyg4ometry: A Python library for the creation of Monte Carlo radiation transport physical geometries”, Computer Physics Communications 272 108228 (2022). DOI: 10.1016/j.cpc.2021.108228

and the Zenodo release: DOI

Citation information can be also obtained on GitHub by selecting “Cite this repository” in the sidebar on the right.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyg4ometry-1.4.2.tar.gz (7.0 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyg4ometry-1.4.2-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (34.5 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.17+ x86-64

pyg4ometry-1.4.2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (34.4 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

pyg4ometry-1.4.2-cp313-cp313-win_amd64.whl (7.7 MB view details)

Uploaded CPython 3.13Windows x86-64

pyg4ometry-1.4.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (34.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

pyg4ometry-1.4.2-cp313-cp313-macosx_14_0_arm64.whl (7.5 MB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

pyg4ometry-1.4.2-cp313-cp313-macosx_13_0_x86_64.whl (8.4 MB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

pyg4ometry-1.4.2-cp312-cp312-win_amd64.whl (7.7 MB view details)

Uploaded CPython 3.12Windows x86-64

pyg4ometry-1.4.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (34.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

pyg4ometry-1.4.2-cp312-cp312-macosx_14_0_arm64.whl (7.5 MB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

pyg4ometry-1.4.2-cp312-cp312-macosx_13_0_x86_64.whl (8.4 MB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

pyg4ometry-1.4.2-cp311-cp311-win_amd64.whl (7.7 MB view details)

Uploaded CPython 3.11Windows x86-64

pyg4ometry-1.4.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (34.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

pyg4ometry-1.4.2-cp311-cp311-macosx_14_0_arm64.whl (7.5 MB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

pyg4ometry-1.4.2-cp311-cp311-macosx_13_0_x86_64.whl (8.3 MB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

pyg4ometry-1.4.2-cp310-cp310-win_amd64.whl (7.6 MB view details)

Uploaded CPython 3.10Windows x86-64

pyg4ometry-1.4.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (34.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

pyg4ometry-1.4.2-cp310-cp310-macosx_14_0_arm64.whl (7.4 MB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

pyg4ometry-1.4.2-cp310-cp310-macosx_13_0_x86_64.whl (8.2 MB view details)

Uploaded CPython 3.10macOS 13.0+ x86-64

pyg4ometry-1.4.2-cp39-cp39-win_amd64.whl (7.7 MB view details)

Uploaded CPython 3.9Windows x86-64

pyg4ometry-1.4.2-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (34.3 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

pyg4ometry-1.4.2-cp39-cp39-macosx_14_0_arm64.whl (7.4 MB view details)

Uploaded CPython 3.9macOS 14.0+ ARM64

pyg4ometry-1.4.2-cp39-cp39-macosx_13_0_x86_64.whl (8.2 MB view details)

Uploaded CPython 3.9macOS 13.0+ x86-64

pyg4ometry-1.4.2-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (34.3 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

File details

Details for the file pyg4ometry-1.4.2.tar.gz.

File metadata

  • Download URL: pyg4ometry-1.4.2.tar.gz
  • Upload date:
  • Size: 7.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pyg4ometry-1.4.2.tar.gz
Algorithm Hash digest
SHA256 9c64cea54feeb73c9a7812eeafc2932cbe628307aef27a927fce67e45b7ca79d
MD5 5149c52705c1aa125a0da0ea2d76ee09
BLAKE2b-256 75f54e9f1834eec2f2514c905fb985a4a019eff2816859ee034f3769ee66b1d1

See more details on using hashes here.

File details

Details for the file pyg4ometry-1.4.2-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for pyg4ometry-1.4.2-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 5122a1d053ee44cde0f65f5196ec3689a7aa04998f3b997f8c2ef82ca0094de2
MD5 1672892d2623c8f47d9982d7024ea823
BLAKE2b-256 6ea1d72eb6ec70510680993f97a42677bf4be187c836de79a0edc3e070a0dfd0

See more details on using hashes here.

File details

Details for the file pyg4ometry-1.4.2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for pyg4ometry-1.4.2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 7a47c206d0f106cec4cbaa3760d6c2a254d469ec4f44dd2163437481e136cd06
MD5 929485fa1dd111a351ad2c34ea12eb50
BLAKE2b-256 3e1ddee4c9ea06f648cfea31902fab699a370e6d2d7c45ad9a0e71ae43325fec

See more details on using hashes here.

File details

Details for the file pyg4ometry-1.4.2-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: pyg4ometry-1.4.2-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 7.7 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pyg4ometry-1.4.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 d9b96420120e8a0b818d818c4850a156e1d2f2332b215e27c08b1c312f689513
MD5 1dfe37fb24cf7ceeef40813d9cf9d2f5
BLAKE2b-256 9e77c14870c741eefe7a40dab8fbd945665e0098ef15544de3e62f1fb94627c3

See more details on using hashes here.

File details

Details for the file pyg4ometry-1.4.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for pyg4ometry-1.4.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 adcea9872b6565c022c0f87ec63b3c68812ddd9905a51077c4a30fae8a2f235f
MD5 9a524d32e6ecaaa5d3ac694a1ac200a5
BLAKE2b-256 fa3527b5cc50b2662387b25c82bbe9e4c2a175759bc6408b94d823506cc820cf

See more details on using hashes here.

File details

Details for the file pyg4ometry-1.4.2-cp313-cp313-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pyg4ometry-1.4.2-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 912f5d4e0abfc1d3817f1307e17e3d220c27a7789f538f6fe054bb146e6e32bb
MD5 08c23f374c0a7cfd563df734391462d4
BLAKE2b-256 cacc25213d59698100457251d335e0513ae944a727cfa3de814b8675e39e3b04

See more details on using hashes here.

File details

Details for the file pyg4ometry-1.4.2-cp313-cp313-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for pyg4ometry-1.4.2-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 8d18af58c2df82ac6ce7e3c97b15aca001bae0061996d420907b783a3e69c13e
MD5 3b39b71227ab3442d9cac1956bfc4b19
BLAKE2b-256 4e5f8d6181d2a74a78f1d410bd671bb84c5375cf7b52e377cd91d51d7dc427ca

See more details on using hashes here.

File details

Details for the file pyg4ometry-1.4.2-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pyg4ometry-1.4.2-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 7.7 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pyg4ometry-1.4.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 bcf6cae078dc8079f4ecf6615db2df2b1ba0124e241e9bd66f1d9bed98a1cb65
MD5 5d2cb65476652e923247193f054557e0
BLAKE2b-256 28f0bc932012c3f476b957b1ba12596b29ef1b5fac7673bdc704311834d51e54

See more details on using hashes here.

File details

Details for the file pyg4ometry-1.4.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for pyg4ometry-1.4.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 9f83cc9197ed3e12aff18e08e31a83b334ad330d30b7719154915a971943d536
MD5 9ce9730de865050b78bc3981bf6a1b31
BLAKE2b-256 0f29d2a63268f1ace132bcdec1fbda6c6929727e839b815c9ca732421ebf60a9

See more details on using hashes here.

File details

Details for the file pyg4ometry-1.4.2-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pyg4ometry-1.4.2-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 6f6dd730ca2167f63353e41c54d5c33da0e39482096a6bd56ccefb99a4ccaea3
MD5 9ff32f8163397ac1431b3152cc570624
BLAKE2b-256 42218bfe0880cc1e930568d460ae3798440deba7ff65c614c08b9af4e39d3aa9

See more details on using hashes here.

File details

Details for the file pyg4ometry-1.4.2-cp312-cp312-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for pyg4ometry-1.4.2-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 3dad25231962061c877bb9b4d3d299b5a087f60e628688bcca893dd320c91c21
MD5 f5ca9947bac477600b5a63f733facd18
BLAKE2b-256 fdcdcc44be646ecd9cbb943bcc94fb95b5dc97ebb6e1e3b43c4145b11a83952f

See more details on using hashes here.

File details

Details for the file pyg4ometry-1.4.2-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pyg4ometry-1.4.2-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 7.7 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pyg4ometry-1.4.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 d29957fc9ad343b3ee03c5d0b281e3f15cf7f0de8c79f7598c02d8fd26218709
MD5 b91c3d5f8ce3c58e118b5a7f37c4a44c
BLAKE2b-256 dae6ef9ccd8a51afec0570f7430863e6cbc3cc6674216cb3b46b26b75ff8b648

See more details on using hashes here.

File details

Details for the file pyg4ometry-1.4.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for pyg4ometry-1.4.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 347eda252032e407cddf557df430e1ecee6c45645a57418fa926d4d1dbbd0696
MD5 a327201fc97e0f8480bc1ae6f04c8176
BLAKE2b-256 6d13327fb1eb6b42de6738159c3ed24f26ee7ff32fc5c5457009e7689feaf31d

See more details on using hashes here.

File details

Details for the file pyg4ometry-1.4.2-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pyg4ometry-1.4.2-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 aae9e67bc2e14c1338db3f6e3c12278d52af43c00b56f09378b9734148586817
MD5 0209a5cd707d90ceb6d13a56f74deefb
BLAKE2b-256 35bbcc788319a9dea69b3e20f537462ec87ca777302064184a04c865d23fe568

See more details on using hashes here.

File details

Details for the file pyg4ometry-1.4.2-cp311-cp311-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for pyg4ometry-1.4.2-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 8fc3756a415a96f36011a029d7501de4d145c075f1d5d023ca6997855bc02446
MD5 570c90d581d2d964c386c758d710d162
BLAKE2b-256 2136c70d263dade365a4bcf1f4ac28f313dd08758524b0079b6e6310a9c38f08

See more details on using hashes here.

File details

Details for the file pyg4ometry-1.4.2-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pyg4ometry-1.4.2-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 7.6 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pyg4ometry-1.4.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 a07f396ce1b00c98d2121cfe65f1222df1c55988848a53e3c635553620470e2b
MD5 b9aa4a8e8e0ebed1e237a6c848ea2144
BLAKE2b-256 e9cfa9f351fec72c670fc91be981d29c5ea0697285ba91e22e67590381bfcd2f

See more details on using hashes here.

File details

Details for the file pyg4ometry-1.4.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for pyg4ometry-1.4.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 4c1ab8e746516fc62e9feac433ce47f423169d223b1e1d304ba70854461fa155
MD5 e43fb3b965423b76cf42581bdfeb3437
BLAKE2b-256 cb18e851510f51cd8d37700483de4cd73c3a7eb7218517b047545940d28ba30c

See more details on using hashes here.

File details

Details for the file pyg4ometry-1.4.2-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pyg4ometry-1.4.2-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 4a3a5e2e1ac7ae13d2d851b0ab01dac23e7bec67ac9b8622ec6b46e363cba5eb
MD5 44868864747b19aff79d7353aad5f696
BLAKE2b-256 fc93e891786321eb2b413204d3ba057a9f2db1f2fd3775ea56da05783e283340

See more details on using hashes here.

File details

Details for the file pyg4ometry-1.4.2-cp310-cp310-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for pyg4ometry-1.4.2-cp310-cp310-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 c99cab8f6063b207218f07d5bec48c36870b56ec0f776c8d2fbf762860fcb529
MD5 b401232cd661e0d35d3360c4b4107ddd
BLAKE2b-256 217af12c47081018b7f566ce449989074b78e16d0f370c521562a54ef1d0dd0b

See more details on using hashes here.

File details

Details for the file pyg4ometry-1.4.2-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: pyg4ometry-1.4.2-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 7.7 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pyg4ometry-1.4.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 7d0ffa08efb5c48dbf82a8384b290e5850754c9a885191c3c591c8be1b6203cd
MD5 92efb1b443926e9c3e8b06296841a00d
BLAKE2b-256 58430ddcca316d0112de39a77204afff0473ea2d5d43f5804a66d443014e7f8f

See more details on using hashes here.

File details

Details for the file pyg4ometry-1.4.2-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for pyg4ometry-1.4.2-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 4a889d36973a435192f4d54a42cb7167d2d678bf9dd6e962c280f3ef0a281f2a
MD5 b2d7b87a9580527a177fb3fb93242194
BLAKE2b-256 87b7453a9763daaa479de900579b11591161a87eefbd48db89292ff92bc70250

See more details on using hashes here.

File details

Details for the file pyg4ometry-1.4.2-cp39-cp39-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pyg4ometry-1.4.2-cp39-cp39-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 52b982baf3f3aee1234307391992ab1201c689ffe8228f95439b14b2441bce53
MD5 61657bfc746a87918ca872d5ec8a8f57
BLAKE2b-256 980987f6da330a035d4498f005ff7006bcfac16c6ae74d1660eb60d0887026cb

See more details on using hashes here.

File details

Details for the file pyg4ometry-1.4.2-cp39-cp39-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for pyg4ometry-1.4.2-cp39-cp39-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 7736408acb8a25f9abb96e70ea7b25a735b2025b739805fc1169f065333632ab
MD5 5a39635a956073ae72892e2ef021fd5a
BLAKE2b-256 45ba8cd4cc3883c1746182bb4fafb33781bf5cda76fb1aae9aba44f9c3b1f867

See more details on using hashes here.

File details

Details for the file pyg4ometry-1.4.2-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for pyg4ometry-1.4.2-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 f424b1e73a042c98dcc7e06b80a792fe708ca620d3c115417a2549f3caf1000b
MD5 d5506ea1ad3783badc04985702e94d91
BLAKE2b-256 305b89939e0517ddfa1c1debdff0624276ffee44130ad4aa2b16467317ae07a4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page