EGS is a very popular Monte Carlo code, used in the simulation of Nuclear Medicine devices. Simulation techniques are particularly effective to optimize collimator configuration and camera design in Single Photon Emission studies. With the EGS code, users must define the geometry where particles are transported. This can be both a very hard task and a source of inefficiency, especially in the case of complex geometries as, for instance, hexagonal hole collimators or pixellated detectors. In this paper we present a modular description of such geometries. Our method allows the computation of the region a point belongs to in a few steps; thus we are able to calculate this region in a reduced number of operations, independently of the collimator and detector dimensions. With a modular description we can reduce the computational time by 30%, with respect to a "traditional" description of the geometry. We validated the modular description in the simulation of a Nuclear Medicine apparatus for scintimammography. Two different collimators have been considered: one with square holes and one with hexagonal holes.We accomplished their characterization and tested their performance in a torso-breast phantom. Outcomes of the two collimators are comparable, even if it seems that the hexagonal hole collimator, thanks to its greater septal penetration, could give slightly better results for small tumors located near the collimator.