A General Approach for Optimal Design of Parallel Manipulators