Algorithms for involute and octoidal bevel-gear generation