Preparing everything for building the mesh
merging