X-ray phase-contrast imaging is a high-resolution imaging that permits an increase of the perceptibility of the details in three-dimensional objects, such as human tissues compared to conventional absorption imaging. There are different approaches for implementing phase-contrast imaging and their introduction into clinical practice requires advanced computational tools. A long-term goal of our research is the development of computational models of breast phase-contrast imaging. The aim of this study is to develop a software module for implementing grating-based phase-contrast imaging. For this purpose, an existing in-house software application for x-ray imaging with a function to model and simulate propagation-based phase-contrast x-ray images has been extended to include a model of grating-based imaging. To test the new functionality, four computational phantoms reflecting features, which can be screened in the real breast tissue and which differ in their complexity, were designed. Planar x-ray images in absorption, propagation-based and grating-based modes were generated and compared. Results showed improved visual appearance of the simulated objects in images obtained by simulating grating-based imaging setup. The developed subroutine is planned to be experimentally validated at synchrotron facility. The new software functionality will be exploited in studies related to new x-ray imaging techniques for breast screening and diagnosing.