Merge by shape