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.3.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.3-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.3-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.3-cp313-cp313-win_amd64.whl (7.9 MB view details)

Uploaded CPython 3.13Windows x86-64

pyg4ometry-1.4.3-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.3-cp313-cp313-macosx_15_0_x86_64.whl (8.5 MB view details)

Uploaded CPython 3.13macOS 15.0+ x86-64

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

Uploaded CPython 3.13macOS 14.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

pyg4ometry-1.4.3-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.3-cp312-cp312-macosx_15_0_x86_64.whl (8.5 MB view details)

Uploaded CPython 3.12macOS 15.0+ x86-64

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

Uploaded CPython 3.12macOS 14.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

pyg4ometry-1.4.3-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.3-cp311-cp311-macosx_15_0_x86_64.whl (8.4 MB view details)

Uploaded CPython 3.11macOS 15.0+ x86-64

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

Uploaded CPython 3.11macOS 14.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

pyg4ometry-1.4.3-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.3-cp310-cp310-macosx_15_0_x86_64.whl (8.3 MB view details)

Uploaded CPython 3.10macOS 15.0+ x86-64

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

Uploaded CPython 3.10macOS 14.0+ ARM64

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

Uploaded CPython 3.9Windows x86-64

pyg4ometry-1.4.3-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.3-cp39-cp39-macosx_15_0_x86_64.whl (8.3 MB view details)

Uploaded CPython 3.9macOS 15.0+ x86-64

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

Uploaded CPython 3.9macOS 14.0+ ARM64

pyg4ometry-1.4.3-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.3.tar.gz.

File metadata

  • Download URL: pyg4ometry-1.4.3.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.3.tar.gz
Algorithm Hash digest
SHA256 b311927c5dcde7dc05ec112504eeea2f807c4c2269aff9297b5aa37ec98bd14e
MD5 cd01f147041305b53cc8c8eb83365327
BLAKE2b-256 d68987da5abfb9b1ebb0ffac822de1c6deedcea6c99d503fd4648c95528367b1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyg4ometry-1.4.3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 bbe0c4871676471fad9195b6cb1414d584520369bb0363ed151c8033af786b92
MD5 8340ef6fb32f227a31604758432fb8c4
BLAKE2b-256 f68ae46c8fe0dc49eb8b4ca79c358c1d050e869e0c7d49a774478799a1cd540b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyg4ometry-1.4.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 e62e4782fad8c780e94c32b6989c8cabee0fa83c7dfb35966fe39477d3738ff1
MD5 447826a49d2d2aacad37cbc763046717
BLAKE2b-256 66a977752ac84c81c96a3c3b5554aaf1c84e9e9acd2238584666f34145a9fa94

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyg4ometry-1.4.3-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.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 5a6cf03b462efca38543565215fe6adffaf95beebc7707ac818629e773db135d
MD5 3c131ee1ead1ae180a1db8f0b51ed677
BLAKE2b-256 0f0fbdf9ef7227786a65b3b553cc782958e4df5ec21135a45245940290b73c1e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyg4ometry-1.4.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 4e6745eb4e5b4fc853a4db2eab512be8d748260f40f117bf16f3050c05ecfd97
MD5 b9107dcd9a7fb6580dbf70abe8e5f960
BLAKE2b-256 93ebabf44a9cd545723785bbcb8fc0516943f74ab00e28643dbb2644be1e7ad1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyg4ometry-1.4.3-cp313-cp313-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 c27747abe1eb798f418f37cfa5eb55e619ad99186b9ec141b6af89f394e3329e
MD5 0acbe66807b67c4546792372bdfc54dd
BLAKE2b-256 737d6a0a545f9e7cf9b5fef69d72f9fffff563d4f14de581bb39a9dfdb3b764c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyg4ometry-1.4.3-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 1c33e64f181e0793bff9cca85eaf4593fa2d7816cec1e763f361815ad38cf800
MD5 bc8de09f5b2c2bffcfcdc27cbc3e79c4
BLAKE2b-256 cb4cf54495d3eed3f27ac9811808d732de91360e26d9e41758760064ac5013b5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyg4ometry-1.4.3-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.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 d4cb74ff125f333b784239c965cb05619e4d70d62e2de622ff9404a78843c510
MD5 db019bc25694fee5309197aeceaafe23
BLAKE2b-256 e56aa556ed995dd224ec263fc6bd0f99ac790aad2e9c45a9b0055f2194ad7fdb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyg4ometry-1.4.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 25a36760e6aa79e6c172f69d23f2e11c6ea3cd17941c2dc87c96982482a48913
MD5 ec67ce57d4aef0cc4258e3de3cb7ccbc
BLAKE2b-256 4e720434bec54ef2cc115efb1db10967a0932a6f86aa7ac498326fedc5b2d67a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyg4ometry-1.4.3-cp312-cp312-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 1a3979f756d1617e40abdb93537f81e19bfb176ca03de638b479d48083f4f11e
MD5 68c364043c0070d9710876e3f0fecbbd
BLAKE2b-256 d785eff98c3992a20a532a7f82f295afa7f5e5b0cb7cca17cf6f08104a63b466

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyg4ometry-1.4.3-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 3930286599428d191c0a2cedd7d1da1ce66a0cd82980e19d53418250eaf078a9
MD5 c5d045ad8691bc7f4fac8a6ee860c93a
BLAKE2b-256 c51aaedf42a5fe9473d4071ba3c4e92adcccc1e82db88282db617b7387054775

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyg4ometry-1.4.3-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.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 d6bc5ecc4f72d05e21cbc25191dfb73519fa0f7e6ee00e179798ed6a3d2a8c11
MD5 0c902b3f8cc72e910b650b8305ebb946
BLAKE2b-256 60845cc92e64154c6eb58d4e88890f13ed7f65d57596ffe6500bdc8a89df2502

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyg4ometry-1.4.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 c7dfef1eb672ba3487db8a2a03c1b27552666518a6939622809cf2a8feab3cb8
MD5 d31f6aa578e8d06b135d2a759d7c7fdf
BLAKE2b-256 95d15cb7b67df564be33fea84d388f70cec6d73935e51e2298a067e550eaa106

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyg4ometry-1.4.3-cp311-cp311-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 df1be6a61d6b0d41aba0121aac92dba36c813c186bb73c99da87ce79ef7786e2
MD5 1874c22be54ab335ee24ae538a4c01fd
BLAKE2b-256 6ce871be5d9ada02347bf9267388077f77c3a86dacc73bd0a94f12e93254eb0f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyg4ometry-1.4.3-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 9de54860569157d5aaa2a0a1775032560e7998944aaef91dde3fd864043de142
MD5 fe398a0167693e2140ac1fb8548c584a
BLAKE2b-256 c6b2b52f4e9aa3f17a5b421c713bf8265091b5ebdc47204a4b2e549d5c97b2f0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyg4ometry-1.4.3-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.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 38dbaaeab3b244eac2245c6865f9051425c88e9f81a2e1c1df9a2a6c0a7ee3fb
MD5 015149634409b684dfea4cdde7e34771
BLAKE2b-256 7762ab060cceaf6addd4d1e339bdcf3780fb61a0dbe9b2084d6d0bbb66361273

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyg4ometry-1.4.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 8c0a5eafc1c2c72f3ce50ce96864dbf829e81becc9bff6040c43edf1f3dc25b7
MD5 b58c6da55f9aed2f24549e4bed80e983
BLAKE2b-256 38e48a1745d4e350512aba6d0830b4cc60970e83ce64f526f76c7734d13adc63

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyg4ometry-1.4.3-cp310-cp310-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 7450be246aa51c59c07a4d9bb8faa2b7babc854cb83a906f1ff6d00b88d33877
MD5 ffc290de175fb500b6338e4dd558a6c2
BLAKE2b-256 0b66f5742f9945d1686cbda7573d48922c38f45aa7f4381089f95e1a8a0cc7a5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyg4ometry-1.4.3-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 232420291df4ada0cd7706cc5bb1cfd36a052993c213df69ef498eb2b850c0ad
MD5 bd1d6ecbf7333932476f93ff6d036fcd
BLAKE2b-256 2fb6817934606a06649d5006b9ba3c406351310f70ffe03a30c796a8fdb5861f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyg4ometry-1.4.3-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.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 c6204cbd8b7e4de9c994ce0f2f9333caa1f6bfac1272c7ea8c161ff7b9d82920
MD5 5b505baaef585fdfa60336f17fe646d5
BLAKE2b-256 d2aa494ffb4c3f072f338f8871d4b1350b9da46d77c63658372823f4bfcf5366

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyg4ometry-1.4.3-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 204e879c1659c7209eafdfaa9eebeefdde7c34a8aaa2d54d21f052a4aeec2639
MD5 4277cd846bb3f3461c04c4d5385151a2
BLAKE2b-256 85c3ec7561f66dc5fa67a7e97a90d8ac875a48ef2b044889b4c787bec277bf3e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyg4ometry-1.4.3-cp39-cp39-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 19e25bea4fd56634dedc18e1004de3905a5630e1efaaa4bc0237bf2db7cf7a3e
MD5 09416ff39e836e0e9ed7d895d3a64204
BLAKE2b-256 0a5fa415ed0e7518e59ee98182e8d20d9872dab70e1094d9cee333718c580bd6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyg4ometry-1.4.3-cp39-cp39-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 60e72fb156e174c5ea451cea3cff59809515d6c6a0d2f58f36bb5d73dcafed24
MD5 6ae26d1dc3cddd5bd0e7584d82ec3520
BLAKE2b-256 f1a78d387fd13d0b352bec51d28ea00d4b8056f36355d277fd9ec91ae416b9fd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyg4ometry-1.4.3-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 63502a4515d0a9f97bdf955a68ec15af756c1319be967951603a24fe60f278c1
MD5 d6c2bfc2ee2b95167c9e6e734d742394
BLAKE2b-256 e60a26f5c647d452e47a98d8eff5dc379ca3333a365843969a63baff6eb5c945

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