A formulation for the workspace boundary of general N-revolute manipulators