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.4.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.4-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (34.8 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.17+ x86-64

pyg4ometry-1.4.4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (34.7 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

pyg4ometry-1.4.4-cp313-cp313-win_amd64.whl (7.9 MB view details)

Uploaded CPython 3.13Windows x86-64

pyg4ometry-1.4.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (34.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

pyg4ometry-1.4.4-cp313-cp313-macosx_15_0_x86_64.whl (8.5 MB view details)

Uploaded CPython 3.13macOS 15.0+ x86-64

pyg4ometry-1.4.4-cp313-cp313-macosx_14_0_arm64.whl (7.8 MB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

pyg4ometry-1.4.4-cp312-cp312-win_amd64.whl (7.9 MB view details)

Uploaded CPython 3.12Windows x86-64

pyg4ometry-1.4.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (34.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

pyg4ometry-1.4.4-cp312-cp312-macosx_15_0_x86_64.whl (8.5 MB view details)

Uploaded CPython 3.12macOS 15.0+ x86-64

pyg4ometry-1.4.4-cp312-cp312-macosx_14_0_arm64.whl (7.8 MB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

pyg4ometry-1.4.4-cp311-cp311-win_amd64.whl (7.8 MB view details)

Uploaded CPython 3.11Windows x86-64

pyg4ometry-1.4.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (34.8 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

pyg4ometry-1.4.4-cp311-cp311-macosx_15_0_x86_64.whl (8.4 MB view details)

Uploaded CPython 3.11macOS 15.0+ x86-64

pyg4ometry-1.4.4-cp311-cp311-macosx_14_0_arm64.whl (7.8 MB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

pyg4ometry-1.4.4-cp310-cp310-win_amd64.whl (7.8 MB view details)

Uploaded CPython 3.10Windows x86-64

pyg4ometry-1.4.4-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (34.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

pyg4ometry-1.4.4-cp310-cp310-macosx_15_0_x86_64.whl (8.3 MB view details)

Uploaded CPython 3.10macOS 15.0+ x86-64

pyg4ometry-1.4.4-cp310-cp310-macosx_14_0_arm64.whl (7.7 MB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

pyg4ometry-1.4.4-cp39-cp39-win_amd64.whl (7.9 MB view details)

Uploaded CPython 3.9Windows x86-64

pyg4ometry-1.4.4-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (34.7 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

pyg4ometry-1.4.4-cp39-cp39-macosx_15_0_x86_64.whl (8.3 MB view details)

Uploaded CPython 3.9macOS 15.0+ x86-64

pyg4ometry-1.4.4-cp39-cp39-macosx_14_0_arm64.whl (7.8 MB view details)

Uploaded CPython 3.9macOS 14.0+ ARM64

pyg4ometry-1.4.4-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (34.7 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

File details

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

File metadata

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

File hashes

Hashes for pyg4ometry-1.4.4.tar.gz
Algorithm Hash digest
SHA256 83181b1a78ab46384c4735ddd2a43f272ba77be55a569b6cde67bc7a30ddef1f
MD5 87390337576a76307930fd81098e8442
BLAKE2b-256 9a483886711976f23e2fa0aff67f0ac670fc02a1729959b4910cf4f629d6bb43

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyg4ometry-1.4.4-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 0976878ab861d64c5c387311b0684714b5db5bfef5c8e6f758190749009634db
MD5 59d6fe3d804b9d8ebe4a88c0ceb6b3fa
BLAKE2b-256 c4e86d08e801a79c3e4d7ddd5ab3c7b1bdfa004741a5c81e0688c8178741f8fd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyg4ometry-1.4.4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 b981ade1d172b714be42e8e3ea36833a81ae57044f242c8aec56a86a8bd5e355
MD5 4bd58de3ebc3c29e8e5070e56b9e8755
BLAKE2b-256 edc57b77da3e8005bb9ce4d7ea39b002b275a48eae8dee704e0a54b8998b2149

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pyg4ometry-1.4.4-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 2502e9182f082325c6929bc24ae28c7759265cf65120413c3cfa8b7612eaed66
MD5 80c5adc6dbbd35e76a5b7dd10e3d4ca2
BLAKE2b-256 5a99da0f19aabb7681d1b967811f403cb8a50ee0c8f0cfdf484c9e5db3e6bf39

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyg4ometry-1.4.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 205550eade9804f125c5c216bc420252d05656ca641ff23a6ffab0f2f898cd7a
MD5 dc205588bc35e1683759cb5cd24a9b70
BLAKE2b-256 2eca889bf49ae2ddf7fe5ea46daeef02ab7d6728fe2adecc6d00975c066230a5

See more details on using hashes here.

File details

Details for the file pyg4ometry-1.4.4-cp313-cp313-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for pyg4ometry-1.4.4-cp313-cp313-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 fabe9a746cf19f18960d0b766ec40255be4fc8fe26326b2c8819e6ec7f234cf9
MD5 4b3e9a5dfdfab2cfc89f32cb6c27b451
BLAKE2b-256 899eb7ab1e11d0e5423e66b6579c8dd3e7c2f9b83ee44cfab752243cbc73a0da

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyg4ometry-1.4.4-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 0e1600af91eb673bf705d883967ed15c46ffcc52e7c1bb119ebe432a1f5719f7
MD5 1cffa6cbc5370199fb9d00354ba24c17
BLAKE2b-256 65932632423296568f2820b4ee61159fec5aae09df378daae769d64fbc1eeacd

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pyg4ometry-1.4.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 ec3dbfa429342b9e2b6e114eee7ee5db7171e919baf34a8ae7ce49e4ed94cc1f
MD5 84a6616e4666e3c98a7ceb95a0dcd9fd
BLAKE2b-256 378b654ece8c6019e55dab4875698359732586a4026df03a1cc26831ab379d82

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyg4ometry-1.4.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 7942daae5d5ee4d80af3617138b946dfe9a396a81f389173de8b976e1d569f61
MD5 0f2d06b01243dbe03ee265a6ab84162d
BLAKE2b-256 7e4aaf268b8902a86f96e2ef8421504b7dee295c6cd0a657f64bf710e7e792bc

See more details on using hashes here.

File details

Details for the file pyg4ometry-1.4.4-cp312-cp312-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for pyg4ometry-1.4.4-cp312-cp312-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 e48ec49750f05937cc54d4db11ca35856f143535c019bf5b2449b6cee9eb1330
MD5 9ae4442154abb13582ac5049db2aaaaa
BLAKE2b-256 6d6c8ac8aa06d63d40cbd6339d45c0faffeb8beae8aef985fa1c05b8a76ecfb3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyg4ometry-1.4.4-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 80a7258c638a10dc74d4fc772afdfd081ec8df010183d45a84780dafaaf30110
MD5 7b6bfb301e9a96bad3453feda5932dee
BLAKE2b-256 9796feb57207747439a92f1f276b6b94c6f90a7df76a7f0a4f18e0038c0f4f45

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pyg4ometry-1.4.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 06a919f6881228d221027459dc72eecfd079462d397c765c3c4a5c7c2477432d
MD5 5c8a238d001296fa66e162c16e92fe0f
BLAKE2b-256 83a8224da22777ac6b1e8796218b31e57f59f4ecf50f9877201e7b2670a0c065

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyg4ometry-1.4.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 4df201c7defffbea53c92f40cedb97bb991717adb494f0999e892a2d1956981d
MD5 6bb4a977350913339a6f522c362ce96a
BLAKE2b-256 256643e4cf5ddc0b5fd88e57c46eab18a522a56d95676f0bb6000e7ed9e31114

See more details on using hashes here.

File details

Details for the file pyg4ometry-1.4.4-cp311-cp311-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for pyg4ometry-1.4.4-cp311-cp311-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 5e6912e0c375bd59de0b94f20d337873057cdcbba9331e74c639b00bb60af1fd
MD5 7177766c403719bb3bc0692836939f61
BLAKE2b-256 2ae35ff5cdeacc94df07272303058be8a5fbbafbbc418d7b61c0d3351a09fe4c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyg4ometry-1.4.4-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 b1ebe417590643b59731a3f6835cdd7cbd112a1aab094ee8b4839340728db825
MD5 7d0c48cfda26ba501ae0b30d77f174b5
BLAKE2b-256 b43b0c388157e57270abc2acfbbaa8edc9ddbf170e27bad0db16cbf1fce6fb39

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pyg4ometry-1.4.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 6e219cbae7ccb631ca9592eb466d5b6bc0b125ed59f6f791e768d563afe34a0e
MD5 8577da70f28b42915f20214fbbccce72
BLAKE2b-256 734156e43824e090179fea643e8b8031f92e0f9de9d16853be170a9825d35869

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyg4ometry-1.4.4-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 4c96e089cf7ee6c4c84970bd229560620e1fae56a60449fc8ba9742935dd8e48
MD5 36d297404b40fb348ccedd2c2454ec79
BLAKE2b-256 54b6d768c4f6585b3aeba71b7e11f572640e249f63f861dc93972275417651b2

See more details on using hashes here.

File details

Details for the file pyg4ometry-1.4.4-cp310-cp310-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for pyg4ometry-1.4.4-cp310-cp310-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 9da8948377f37952c15c792d187103e6534be0a1c5d0575fd86b4d87b0dd5312
MD5 d9e1b6a407465ebb08a72e8579b56307
BLAKE2b-256 0312d50806fada8e74f55769b7fcf22e388e54a998ada17a5778fd85bbc3181c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyg4ometry-1.4.4-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 67e7af9f32f89abbd6ff1232c55c302a3cf4674521cc4f98f96ebd610226c600
MD5 7265e5dc1689628f54ddc2e8366fcb45
BLAKE2b-256 fb47755934edaacfd50ffceedff9be74132887d01367a626260f5c787d957777

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pyg4ometry-1.4.4-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 05aa7518c801fa510eee013fbaead9afe13b1f4fec3dda7c3c1579d6a70d8228
MD5 fdf17c1e928cc68d62d74f37518d009e
BLAKE2b-256 c3a7f84f0047016a9b36d0b6217a8914aaa802dd7f4cbabb82fd3a77e9297859

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyg4ometry-1.4.4-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 9a09d48a98d48abe2cfcdd1066c75623902bbfae0ea2726e73e1510b1ef68d08
MD5 10f3260e86984bac53d95e2e39484826
BLAKE2b-256 2952ae4ae2a886cbf8c8db3afbbe494e59cf5f3a56143f94311225db4ee21a62

See more details on using hashes here.

File details

Details for the file pyg4ometry-1.4.4-cp39-cp39-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for pyg4ometry-1.4.4-cp39-cp39-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 33f65170556d7360351a32ea860c70159809cc21e64a6a6a645dc904b7408fe6
MD5 490d2889815933545a14f5da4f07fc25
BLAKE2b-256 c78b8a8582f0e96b650e84e38c4882f88174f4b0eb920762f492fa4d56ecc645

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyg4ometry-1.4.4-cp39-cp39-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 c0116bc0270225abf7bc5a866128770f8bdf3de3f0923d4f9c263013042ca565
MD5 a35dedff54c64c5d02ed8ab30b9159f1
BLAKE2b-256 0da8760970b64c26ae2c04ceedd7aff6f638512f2730abf7665076a4f469c4e2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyg4ometry-1.4.4-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 d99dbbbde0ff9dc2b3570170d010c5571acf31548b6831bd760afb5bdffe29c9
MD5 a6585cf8fd08b227c1f87352a8173973
BLAKE2b-256 5ce9c237e332d9ec9612536538e4352ce71b6b72a4813c003455b7213b634993

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