An automatic coarse and fine surface mesh generation scheme based on medial axis transform: Part i algorithms