a method for transferring a fractured pattern decomposed into elementary shapes , onto a substrate by direct writing by a particle or photon beam , comprises a step of identifying at least one elementary shape of the fractured pattern , called removable elementary shape , whose removal induces modifications of the transferred pattern within a preset tolerance envelope ; a step of removing the removable shape or shapes from the fractured pattern to obtain a modified fractured pattern ; and an exposure step , comprising exposing the substrate to a plurality of shots of a shaped particle or photon beam , each shot corresponding to an elementary shape of the modified fractured pattern . a computer program product for carrying out such a method is provided .