Tool path generation by offsetting curves on polyhedral surfaces based on mesh flattening