A method to automatically generate Polycube mapping