OpenGATE / opengate

Gate 10 (beta)
http://www.opengatecollaboration.org
GNU Lesser General Public License v3.0
43 stars 38 forks source link

Improve the user interface for repeated volumes #305

Closed nkrah closed 9 months ago

nkrah commented 9 months ago

Currently, volume repetitions are handled via the repeat parameter which takes a list of dictionaries as input. This interface is a bit clumsy and I think error-prone. What happens behind the scenes is actually very simple: If an object is to be repeated, Gate will simply instruct Geant4 to construct multiple physical volumes, each with its own translation (with respect to the mother volume) and rotation.

It would be much more natural for the user to simply specify multiple translations for a volume, i.e., instead of setting vol.translation to one 3-vector, it could be a list of 3-vectors. The same for rotation. If only one rotation is provided, this will be applied to all copies. Otherwise, the list of rotations and of translations will have to match.

Helper functions can be implemented to generate such lists of translations/rotations for typical arrangements.

The name of the repetitions should be generated automatically.

nkrah commented 9 months ago

PR #288 now implements this. Doc will be updated soon.

nkrah commented 9 months ago

Merged into master. Doc is updated. closing this