The algorithm is described and the properties of a previously unknown modification of the Sierpinsky carpet are studied. An example of proposed algorithm application for the fractal simulation of a really observed domain structure is given. An experimental study of light diffraction in the Fraunhofer zone was performed on computer-generated images of modified Sierpinsky carpets of different generations transferred to a transparent film using a high-resolution imagesetter with a small dot size. The observed diffraction patterns are compared with Fourier images of prefractals pictures approximated by the grid function.