A new algorithm for optimal process parameters based on minimum building time in additive manufacturing