A generic algorithm for a best part orientation system for complex parts in rapid prototyping