A Generalized Framework for Concentric Tube Robot Design Using Gradient-Based Optimization