Collapse of masonry arches in Romanesque and Gothic constructions